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

So when i do a brickcolor=brickcolor.random it always gives me the same colors?

local fonzi = coroutine.create(function()
	while true do
	luis.BrickColor=BrickColor.Random()
	wait(.5)	
	end 
end)
coroutine.resume(fonzi)

so whenever i run this, it will return a random color for the brick PS luis is an instanced in part, but it will always just give me different shades of the same rgb such as red or green or blue, and doesn't differentiate, plz help <3

1 answer

✓ Accepted answer

.Random() is likely running on the same pattern because it has not been reseeded. You can try this method for a truly "random" color.

local fonzi = coroutine.create(function()
	math.randomseed(tick()) --Randomize the server's seed (change the pattern of math.random()) 

	while true do
		local randcolor = Color3.fromRGB(math.random(0,255), math.random(0,255), math.random(0,255)) --Randomize three RGB values

		luis.BrickColor=BrickColor.new(randcolor) 
		wait(.5)    
	end 
end)
coroutine.resume(fonzi)

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