if (math.random(1,4)) > 2 then
game.Workspace.Baseplate.BrickColor = BrickColor.new("Pastel green")
end
✓ ANSWER ACCEPTED
Anyone that can help me with this script that im testing (math.random) ?
1 answer
✓ Accepted answer
You should define math.random() as a variable because it makes it easier to work with like i have done below.
local function BrickColorChange (Part)
local RandomizedNumber = math.random(1,4)
print(RandomizedNumber)
if RandomizedNumber > 2 then
Part.BrickColor = BrickColor.new("Pastel green")
end
end
BrickColorChange(workspace.Baseplate)
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Thats how you do a randomizer! thank you so much :D
Np