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

How do you make a GUI which changes colour?

Asked by 9 years ago

Hi,

I've been trying to make a GUI which can change colours. It doesn't seem to work, despite changing the repeat loop to a while true loop. This is what I have got so far:

box = script.Parent
while true do
     for i = 1,0,1/255 do
      box.TextColor3 = Color3.new(i,i,i)
      wait()
     end
 wait ()
end
0
You're going from 1 to 0, you want to make the third parameter in your for loop a negative number or else it will never achieve 0. M39a9am3R 3210 — 9y

1 answer

Log in to vote
0
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
9 years ago

A decreasing numerical for loop requires a negative interval. The 1/255 interval should be -1/255 instead (rather -1/256).

0
Thanks! <3 EricDasCaveman69 20 — 9y
Ad

Answer this question