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

WHAT DO I DO!? IT DOESNT CHANGE THE COLOR AND ITS DRIVING ME CRAZY

local textcolor = script.Parent.TextColor3

wait()
while true do

	textcolor = Color3.new(255,0,0)
	textcolor = Color3.new(0,255,0)
	textcolor = Color3.new(0,0,255)
	textcolor = Color3.new(255,255,0)
	textcolor = Color3.new(0,255,255)

	wait(0.1)

end

I ALSO TRIED COLOR3.FROMRGB

2 answers

✓ Accepted answer

First: don't use Color3.new() if you're using 0-255 numbers.

Second: by doing textcolor = Color3.fromRGB(255,0,0), you're actually changing the value that the variable is holding. If you're willing to change a property, you have to refer to the object and then using that to change the property.

So this would be it:

local textcolor = script.Parent

wait()
while true do

    textcolor.TextColor3 = Color3.fromRGB(255,0,0)
    textcolor.TextColor3 = Color3.fromRGB(0,255,0)
    textcolor.TextColor3  = Color3.fromRGB(0,0,255)
    textcolor.TextColor3  = Color3.fromRGB(255,255,0)
    textcolor.TextColor3  = Color3.fromRGB(0,255,255) -- Btw, the TextColor will keep setting to this because there's not wait between changing the other colors.

    wait(0.1)

end

Pretty much everything that rabbi99 said, just a bit of change with the code.

local textcolor = script.Parent

while true do
 	local r, g, b = math.random(0, 255), math.random(0, 255), math.random(0, 255)
	textcolor.TextColor3 = Color3.fromRGB(r, g, b)

	wait(.1)
end

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