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

Help with disco script?

Asked by 8 years ago

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

Log in to vote
0
Answered by 8 years ago

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)])
0
Thanks so much! Zarnias 0 — 8y
0
Can you answer it? docrobloxman52 407 — 8y
0
Use accept as answer so people know its answered. Hexcede 52 — 8y
Ad

Answer this question