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

math.random Color3 help?

I was trying to make it so it changes to a random color within a range of (255 - 200) so they can I always be a neon color, What am I doing wrong??

sp = script.Parent
NUM1 = sp.NUM1
while true do
	NUM1:TweenSize(UDim2.new(0, 800,0,math.random(-600,0)),"Out","Linear",0.1,false)
	NUM1.BackgroundColor3 = Color3.new(math.random(255,200)/255,math.random(255,200)/255,math.random(255,200)/255)
	wait(0.05)
end

2 comments

0

Why is the larger number first in the math.rendom statements on line 5?

0

Because there can be

1 answer

as GoldPhysics mentioned, math.random requires the first parameter to be smaller than the second.

math.random(200,255) is therefore valid, but what you have, math.random(255,200) is not. The output would state this.

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