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

How do you use [] with math.random?

Im scripting something that HAS to be randomly generated in a table But I dont know how to randomly generate it, without using math.random, And I dont know how to use math.random, Any Examples???

EDIT 1

I want a Brick To change Colors In a Pattern Like a Wave But Randomly generated I need to know how to use [] and math.random to generate a random color in a brick.

2 comments

0

Can you please explain yourself much better?

0

Alright let me fix it

1 answer

Colors = {"Bright blue","Bright red"}

interval = 1

while wait(interval) do
script.Parent.BrickColor = BrickColor.new(Colors[math.random(1,#Colors)])
end

There! Put real colors where the "Colors" table is If you don't want to set it do this:

interval = 1

while wait(interval) do
script.Parent.BrickColor = BrickColor.Random
end

3 comments

0

Made typo whoops

0

I fixed it!

0

Okay.. Then...

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