Hello,
This is one way you can randomly change the colour of the text button is by doing this. I will explain it in the script. I have done it with Color3, not Color3.fromRGB
FINAL SCRIPT USING Color3.new()
local button = script.Parent
while true do
wait(1)
button.TextColor3 = Color3.new((math.random()), (math.random()),( math.random()))
end
So, leaving the brackets blank means that the values that the math.random() function will return is a decimal between 0 and 1
I printed math.random() and this was the output
0.54552773666264
0.2989054301143
0.084517205494783
0.24972764937719
0.90271937913953
0.86965136187734
and the values for Color3 have to be a number between 0 and 1, and math.random() will fetch you a multitude of decimals between 0 and 1.
If this helped, please accept it. Thanks!
7 comments
I'd try adding a dely above the Script, sometimes the Scriot can fun faster than the assets can load, it won't tell you it's nil
I see what you're trying to do. if the script is local, change the text color from the player gui instead of the native gui
Wym?
game.Players.LocalPlayer.PlayerGui.ScreenGui.TextLabel.TextColor3
Please have a look at my answer. Thanks
When you do something like
local Variable = ValueObj.Value, it's not defining theValueproperty, it's saving what the value is for theValueproperty; the simple solution's just to set the.Valueeach time you plan on doing it. (For example, TxtLbl.Color3 = Blah and no TxtLblColor3 = Blah)MCandRobloxUnited is doing it the long way around. Look at my answer. It works for me.