script.Parent.ClickDetector.MouseClick:Connect(function()
local brck = script.Parent.Color == Color3.fromRGB(255,255,255)
for i = 1, 255 do
brck = brck - Color3.fromRGB(1,1,1)
wait()
end
end)
gives error mentioned in title
script.Parent.ClickDetector.MouseClick:Connect(function()
local brck = script.Parent.Color == Color3.fromRGB(255,255,255)
for i = 1, 255 do
brck = brck - Color3.fromRGB(1,1,1)
wait()
end
end)
gives error mentioned in title
Can I ask why you're attempting to set its color in the same line of you defining it? Thats changing its value into a boolean because you used "=="
You can't write
local brck = script.Parent.Color == Color3.fromRGB(255,255,255)
You have to write
local brck = script.Parent.Color
brck = Color3.fromRGB(255,255,255)
Then
script.Parent.ClickDetector.MouseClick:Connect(function()
local brck = script.Parent.Color
brck = Color3.fromRGB(255,255,255)
for i = 1, 255 do
brck = brck - Color3.fromRGB(1,1,1)
wait()
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.