01 | local textcolor = script.Parent.TextColor 3 |
02 |
03 | wait() |
04 | while true do |
05 |
06 | textcolor = Color 3. new( 255 , 0 , 0 ) |
07 | textcolor = Color 3. new( 0 , 255 , 0 ) |
08 | textcolor = Color 3. new( 0 , 0 , 255 ) |
09 | textcolor = Color 3. new( 255 , 255 , 0 ) |
10 | textcolor = Color 3. new( 0 , 255 , 255 ) |
11 |
12 | wait( 0.1 ) |
13 |
14 | end |
I ALSO TRIED COLOR3.FROMRGB
First: don't use Color3.new() if you're using 0-255 numbers.
Second: by doing textcolor = Color3.fromRGB(255,0,0), you're actually changing the value that the variable is holding. If you're willing to change a property, you have to refer to the object and then using that to change the property.
So this would be it:
01 | local textcolor = script.Parent |
02 |
03 | wait() |
04 | while true do |
05 |
06 | textcolor.TextColor 3 = Color 3. fromRGB( 255 , 0 , 0 ) |
07 | textcolor.TextColor 3 = Color 3. fromRGB( 0 , 255 , 0 ) |
08 | textcolor.TextColor 3 = Color 3. fromRGB( 0 , 0 , 255 ) |
09 | textcolor.TextColor 3 = Color 3. fromRGB( 255 , 255 , 0 ) |
10 | textcolor.TextColor 3 = Color 3. fromRGB( 0 , 255 , 255 ) -- Btw, the TextColor will keep setting to this because there's not wait between changing the other colors. |
11 |
12 | wait( 0.1 ) |
13 |
14 | end |
Pretty much everything that rabbi99 said, just a bit of change with the code.
1 | local textcolor = script.Parent |
2 |
3 | while true do |
4 | local r, g, b = math.random( 0 , 255 ), math.random( 0 , 255 ), math.random( 0 , 255 ) |
5 | textcolor.TextColor 3 = Color 3. fromRGB(r, g, b) |
6 |
7 | wait(. 1 ) |
8 | end |