roblox script to create brick

-- Step 1: Create a new Part for the brick
local newBrick = Instance.new("Part")

-- Step 2: Set properties for the brick
newBrick.Size = Vector3.new(10, 5, 2) -- Set the size of the brick
newBrick.Position = Vector3.new(0, 5, 0) -- Set the position of the brick
newBrick.BrickColor = BrickColor.new("Bright red") -- Set the color of the brick

-- Step 3: Parent the brick to the Workspace
newBrick.Parent = game.Workspace

-- Step 4: Example of adding a special material (Optional)
local specialMaterial = Instance.new("SpecialMesh")
specialMaterial.MeshType = Enum.MeshType.Brick
specialMaterial.Parent = newBrick

-- Step 5: Example of adding a ClickDetector for interaction (Optional)
local clickDetector = Instance.new("ClickDetector")
clickDetector.Parent = newBrick

-- Step 6: Example of connecting a function to the ClickDetector (Optional)
local function onClick()
    print("Brick clicked!")
end

clickDetector.MouseClick:Connect(onClick)