Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make this color changing script work? I'm new to scripting

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

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

4 comments

0

Lol, I'm sorry. I had made an incorrect script 2 times. So i have to edit it 2 times.

0

But It work's now!

0

Hope your happy with it.

0

Thank you, that really helps!

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.

(TweenService)

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.