Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how do i make my color change?

i am trying to make a disco floor but when i am trying to set it true and then when i am trying to having it false the studio saids i got the problem with this '=' in between the brick color and he status i want.

while true do
workspace.Part.BrickColor = BrickColor.Red() = true
wait (5)
workspace.Part.BrickColor = BrickColor.Red() = false
workspace.Part.BrickColor.g = true
wait (5)
workspace.Part.BrickColor.g = false
	
end

repeat until false

2 answers

✓ Accepted answer

I think that you need to look into the basics of scripting:-

workspace.Part.BrickColor = BrickColor.Red() = true

Using the "=" in lua assigns the value, what you are trying to do is variable = [ assign value] = [assign value]

Also "g" is a read only property BrickColor and does not use Boolean value any way.

The fix

while true do
	wait(1)
	workspace.Part.BrickColor = BrickColor.Red()
	wait(1)
	workspace.Part.BrickColor = BrickColor.Blue() -- change to another colour
end

You had the correct way of changing the brock colour but you still need to go back and re-learn some scripting.

This code is only an example and as it does not check for the brick but this is something that you need to learn. hint:- WaitForChild

while true do
    wait(1)
    workspace.Part.BrickColor = BrickColor.new("Really red")
    wait(1)
    workspace.Part.BrickColor = BrickColor.new("Really blue") -- changes the color
end

This discussion is preserved as it was. New answers, comments, and votes are closed.