Text color3 not working

So in my game, I have players rank up but I would like to change the colour of the text when they are able to rank up from white to a flashing red but I can’t get it to work.

local plr = game.Players.LocalPlayer
while wait() do
if (plr.leaderstats.Rank.Value*1000) +1000 <= plr.leaderstats.Sugar.Value then

	while true do
		script.Parent.TextColor3 (255,0,0)
		wait(0.5)
		script.Parent.TextColor3 (255,255,255)
		wait(0.5)
	end
else
	script.Parent.TextColor3 (255,255,255)
	
end

end

Try this:

local plr = game.Players.LocalPlayer
while wait() do
if (plr.leaderstats.Rank.Value*1000) +1000 <= plr.leaderstats.Sugar.Value then

	while true do
		script.Parent.TextColor3 = Color3.fromRGB(255,0,0)
		wait(0.5)
		script.Parent.TextColor3 = Color3.fromRGB(255,255,255)
		wait(0.5)
	end
else
	script.Parent.TextColor3 = Color3.fromRGB(255,255,255)
	
end
end

https://developer.roblox.com/en-us/api-reference/property/TextBox/TextColor3

I recommend looking at the api, it helps

in your case you want to use Color3.fromRGB()

1 Like

Thank you so much! I feel dumb now.