TextLabel Text not becoming rainbow

Try this

local RS = game:GetService("RunService")
local rainbow = script.Parent  -- Text Label
local grad = rainbow.UIGradient
local counter = 0      
local w = math.pi / 12  
local CS = {}           
local num = 15 			
local frames = 0		

RS.Heartbeat:Connect(function()
	if math.fmod(frames, 2) == 0 then
		for i = 0, num do
			local c = Color3.fromRGB(127 * math.sin(w*i + counter) + 128, 127 * math.sin(w*i + 2 * math.pi/3 + counter) + 128, 127*math.sin(w*i + 4*math.pi/3 + counter) + 128)
			table.insert(CS, i+1, ColorSequenceKeypoint.new(i/num, c))
		end
		grad.Color = ColorSequence.new(CS)
		CS = {}
		counter = counter + math.pi/40
		if (counter >= math.pi * 2) then
			counter = 0
		end
	end
	if frames >= 1000 then
		frames = 0
	end
	frames = frames + 1
end)

Still makes the text appear as it’s normal color

wait do you want the text to have the gradient effect? or the Background?

The text is what I want to be grad

Oh then make the background transparency 1 and try that

It is, the textbox is a different thing

wait I am confused what are you trying to change the color of?

The text is a textlabel, the box is a textbutton. I’m trying to make the text on the textlabel rainbow

  1. Make the Background Transparency to 1
  2. Change the text color to white (255,255,255)
1 Like