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
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
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.