local Bruh = script.Parent
while true do
wait(1)
Bruh.Color3 = ('0,255,0')
wait(1)
Bruh.Color3 = ('0,0,255')
wait(1)
Bruh.Color3 = ('255,0,0')
wait(1)
end
✓ ANSWER ACCEPTED
How do I make this color changing script work? I'm new to scripting
4 answers
✓ Accepted answer
You cannot change an RGB value (Color3 value) like that.
You use fromRGB()
local Bruh = script.parent
while true do
wait(1)
Bruh.Color = Color3.fromRGB(0,255,0)
wait(1)
Bruh.Color = Color3.fromRGB(0,0,255)
wait(1)
Bruh.Color = Color3.fromRGB(255,0,0)
wait(1)
end
Here:
local Bruh = script.Parent
while true do
wait(1)
Bruh.BrickColor = BrickColor.new(0,255,0)
wait(1)
Bruh.BrickColor = BrickColor.new(0,0,255)
wait(1)
Bruh.BrickColor = BrickColor.new(255,0,0)
end
3 comments
0
Naturedat, It doesn't work like that.
0
Oh nvm, it works. lol
0
Cool :)
HSV has hue as its first value. You could simply tween that value:
local TweenService = game:GetService("TweenService")
local Part = workspace.Part
local Info = TweenInfo.new(1,"Quad","Out",-1) --Except for repeat count, all default values
TweenService:Create(Part,Info,{Color = Color3.fromHSV(1,1,1)}):Play()
Note: changing TweenInfo's repeat count to a negative value will indefinitely loop the tween.
I'm not to good at color stuff but this might work. Also when posting code put it in a lua code block.
local Bruh = script.Parent
while true do
wait(1)
Bruh.Color3 = Color3.fromRGB ('0,255,0')
wait(1)
Bruh.Color3 = Color3.fromRGB('0,0,255')
wait(1)
Bruh.Color3 = Color3.fromRGB('255,0,0')
wait(1)
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
Lol, I'm sorry. I had made an incorrect script 2 times. So i have to edit it 2 times.
But It work's now!
Hope your happy with it.
Thank you, that really helps!