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

Dance Floor Problem?

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?

3 comments

0

Your script works for me.

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.

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.

1 answer

✓ Accepted answer

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

5 comments

0

I thought of using ".Random" but i didn't because it only works on a single part. Or i may be wrong

0

You're right, purple. This only works on one part.

0

Are you saying you want the entire floor to be one color? This script makes every part in TestFloor a different color..

0

Oh, you want EVERY part to update EVERY 0.1 seconds. Script updated.

0

Oh okay t hat worked like a charm :D, thanks for all of your guys help though :)

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