Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how do i make my color change?

Asked by 8 years ago

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

Log in to vote
0
Answered by 8 years ago

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

Ad
Log in to vote
0
Answered by 8 years ago
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

Answer this question