Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Rainbow Text for Textlabels?

Asked by 9 years ago

I was wondering if there was a way I can make my textlabel text change colors throughout the game to sort of rainbow colors.

3 answers

Log in to vote
2
Answered by 9 years ago

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

0
This works for me, did it not for you? User#6200 10 — 9y
0
(I didn't downvote you, but) imo, this question is not a request since the question is "is there a way", not "can someone please make this for me" chess123mate 5873 — 9y
Ad
Log in to vote
0
Answered by 9 years ago

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).

Log in to vote
0
Answered by 5 years ago
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

Answer this question