i tried to make when player click on brick then math.random then brick changing color, but it not works
script.Parent.MouseClick:Connect(function()
local number = math.random(1, 2)
number = math.random(1, 2)
print(number)
if math == 1 then
print("1")
script.Parent.Parent.BrickColor = BrickColor.Random()
if math == 2 then
script.Parent.Parent.BrickColor = BrickColor.Random()
print("2")
end
end
end)

2 comments
No need to define number twice
There's no need for number at all if you're just going to use BrickColor.Random() on the same part. It doesnt make it extra random XD