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

Help with disco script?

My friend and I are working on a game together, and he made this script.

yo = script.Parent

while true do yo.BrickColor = BrickColor.Random() wait(0.5) yo.BrickColor = BrickColor.Random() wait(0.5) yo.BrickColor = BrickColor.Random() end

Currently, it switches to every color in the pallet, which is great, except that it turns brown sometimes. I've tried to edit it, but I'm a total noob when it comes to scripting. Can somebody help?

1 answer

You would make a table that has all the colors that you want to change. Like this:

local colors = {'Bright red', 'Bright green', 'Bright blue'}

Then you would do the math.random. To change the colors randomly

yo.BrickColor = BrickColor.new(colors[math.random(1, #colors)])

3 comments

0

Thanks so much!

0

Can you answer it?

0

Use accept as answer so people know its answered.

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