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

Dance Floor Problem?

Asked by 9 years ago

I made a dance floor today and i was able to change all of the parts colors in the model by using "In pairs" But the problem is that all of the parts just change to a random color and stay that way . I'm trying to make it to where all of them change to different colors every .1 seconds. But instead as i said above they change to a random color but stay that way . Here is the code i though would work but didn't

while true do
for _, v in pairs(workspace.TestFloor:GetChildren()) do
v.BrickColor = BrickColor.new(math.random(),math.random(), math.random())
wait(.1)
    end
end

can someone please help me?

0
Your script works for me. Relatch 550 — 9y
0
It works fine but i'm trying to change the colors of all of the bricks every second, like a dance floor. The script only changes their color to a random one and then it stays that way. purplemetro3421 5 — 9y
0
I'm not sure by what you mean 'stay that way'. In the script you have, although it didn't error. You will have at least one part every 0.1 seccond change color. In order to change all the parts every 0.1, you'll need to move the wait command. Nickoakz 231 — 9y

1 answer

Log in to vote
1
Answered by
Nickoakz 231 Moderation Voter
9 years ago

I believe theres an option for BrickColor.Random()

http://wiki.roblox.com/index.php?title=BrickColor

while wait(.1) do --Move the wait here for the loop to have all the parts change colors every 0.1 seconds.
    for _, v in pairs(workspace.TestFloor:GetChildren()) do
        v.BrickColor = BrickColor.Random()
    end
end
0
I thought of using ".Random" but i didn't because it only works on a single part. Or i may be wrong purplemetro3421 5 — 9y
0
You're right, purple. This only works on one part. Relatch 550 — 9y
0
Are you saying you want the entire floor to be one color? This script makes every part in TestFloor a different color.. Nickoakz 231 — 9y
0
Oh, you want EVERY part to update EVERY 0.1 seconds. Script updated. Nickoakz 231 — 9y
0
Oh okay t hat worked like a charm :D, thanks for all of your guys help though :) purplemetro3421 5 — 9y
Ad

Answer this question