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

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

Asked by 3 years ago
Edited 3 years ago
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

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

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

0
Lol, I'm sorry. I had made an incorrect script 2 times. So i have to edit it 2 times. rayhansatria 142 — 3y
0
But It work's now! rayhansatria 142 — 3y
0
Hope your happy with it. rayhansatria 142 — 3y
0
Thank you, that really helps! mickey10045 -3 — 3y
Ad
Log in to vote
0
Answered by
naturedat 124
3 years ago

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
0
Naturedat, It doesn't work like that. rayhansatria 142 — 3y
0
Oh nvm, it works. lol rayhansatria 142 — 3y
0
Cool :) naturedat 124 — 3y
Log in to vote
0
Answered by
sngnn 274 Moderation Voter
3 years ago
Edited 3 years ago

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)

Log in to vote
0
Answered by 3 years ago

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

Answer this question