I was wondering if there was a way I can make my textlabel text change colors throughout the game to sort of rainbow colors.
This is not a request site Fortunately this is very easy to make, so here it is:
while true do wait(1) script.Parent.TextColor3 = Color3.new(math.random(),math.random(),math.random()) wait() --Add a wait if necessary script.Parent.TextStrokeColor3 = Color3.new(math.random(),math.random(),math.random()) end
All you have to do is put a LocalScript into your TextLabel, then paste this code into it
In addition to what T3XLAlt said, if you meant a gradient (ex a single TextLabel starting as red on the left side of the word and gradually changing to purple on the right side -- a rainbow), you cannot easily do this, as Roblox does not support gradients at this time. The easiest approximation is to make each letter a different colour.
Technically, you could create a gradient by having the same TextLabel in the same spot numerous times, making each one a slightly different colour. Each one would be parented to a different Frame that would have ClipsDescendents = true and would only let the user see a 1 pixel strip of the TextLabel. However, this would be expensive to create and update, and there's a limit to how many gui objects you can put on the screen before Roblox starts to lag (though I'm sure this depends on the computer).
function zigzag(X) return math.acos(math.cos(X*math.pi))/math.pi end counter = 0 while wait(0.1)do script.Parent.TextStrokeColor3 = Color3.fromHSV(zigzag(counter),1,1) counter = counter + 0.01 end
Here is the way i make mine today in 2019 :D Hope it works