Creating a random Color Error

So I have this shirt which I want the color to change but unfortunately, although it does give me a color, when I put it in a loop, it gives me the same color each time. (for their own variables)

while true do
	for count = 1, 10 do
		local ShirtColour = Color3.fromRGB(math.random(255), math.random(255), math.random(255))
		local PantColour = Color3.fromRGB(math.random(255), math.random(255), math.random(255))
		print(ShirtColour)
		print(PantColour)
	end
end

You should do like this:

while true do
	for count = 1, 10 do
		local ShirtColour = Color3.fromRGB(math.random(1, 255), math.random(1, 255), math.random(1, 255))
		local PantColour = Color3.fromRGB(math.random(1, 255), math.random(1, 255), math.random(1, 255))
		print(ShirtColour)
		print(PantColour)
	end
end

It’s not any different because 1 is the default value there.

it appears that the script was actually going so fast that Roblox Physics was a bit delayed, so adding a wait() did the trick.

This issue wasn’t caused due to a delay/latency in Roblox’s physics engine, it was caused because you were cycling through all ten iterations of the numeric for loop within a single frame.

For an easy way to get random Color3 values consider using the following.

BrickColor.Random().Color

How would I wait just a frame then?