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

Why Is This Script Not Working: Changing Beam Color? (Note: Im New To scripting ish)

So im trying to make my spotlight beam change color (in a rainbow form) and ive placed the script in the part where the beam is located in.

why is it not changing the beam color? Note: im trying to make my stage spotlight change colors Script: while true do script.Parent.light = Color3.new(math.random(), math.random(), math.random()) wait(1) end

2 comments

0

Here if you wanted to change smoke color or part color rainbow: local text = script.Parent local add = 10 wait(1) local k = 1 while k <= 255 do text.Color = Color3.new(k/255,0/255,0/255) k = k + add wait() end while true do k = 1 while k <= 255 do text.Color = Color3.new(255/255,k/255,0/255) k = k + add wait() end k = 1 while k <= 255 do text.Color = Color3.new(255/255 - k/255,255/255,0/255) k = k

0

I made a variable I called "k"

2 answers

✓ Accepted answer

You forgot to put .Color when defining the light, so you script would look like this

while true do
	script.Parent.light.Color = Color3.new(math.random(), math.random(), math.random()) 
	wait(1)
end

EDIT: I'm still quite confused on what you are asking, but If I'm understanding right this should work

while true do
    script.Parent.Color = ColorSequence.new(Color3.fromRGB(math.random(0,255),math.random(0,255),math.random(0,255)),Color3.fromRGB(math.random(0,255),math.random(0,255),math.random(0,255))) 
    wait(1)
end

12 comments

0

Where is the script currently?

0

ok so i have a folder called "spots" and i have my "spotlight_!" model and in there is my "body" model and in that body model i have my part "beam" and in there is the beam and the pointlight how could i make the actual beam change rainbow color?

0

my script is in the body model where all the parts like "lens" and beam are at

0

should i put the script where the actual beam is?

0

and im confused cause in ur script u put color but its a beam

0

Wait, so do you want to change the beams color or the lightpoints color?

0

well i want to change the beam of the spotlight rainbow

0

because my game is a nightclub game iand im wanting to change the stage spotlights beam rainbow

0

i want to change the stage spotlight beam to a color changing rainbow

0

THX U HELPED ME!!! UR KING

0

lol, that's what this is for anyways, isn't it? helping other ppl out

0

also, remember to make this your answer so people don't spend time trying to fix it when we already solved the problem.

I made this script for the parts if you were interested in making rainbow parts, this script should also work for smoke. Sadly, this script does not work for Beams, here is the script I made:

local text = script.Parent
local add = 10
wait(1)
local k = 1
while k <= 255 do
text.Color = Color3.new(k/255,0/255,0/255)
k = k + add
wait()
end
while true do
k = 1
while k <= 255 do
text.Color = Color3.new(255/255,k/255,0/255)
k = k + add
wait()
end
k = 1
while k <= 255 do
text.Color = Color3.new(255/255 - k/255,255/255,0/255)
k = k + add
wait()
end
k = 1
while k <= 255 do
text.Color = Color3.new(0/255,255/255,k/255)
k = k + add
wait()
end
k = 1
while k <= 255 do
text.Color = Color3.new(0/255,255/255 - k/255,255/255)
k = k + add
wait()
end
k = 1
while k <= 255 do
text.Color = Color3.new(k/255,0/255,255/255)
k = k + add
wait()
end
k = 1
while k <= 255 do
text.Color = Color3.new(255/255,0/255,255/255 - k/255)
k = k + add
wait()
end
while k <= 255 do
text.Color = Color3.new(255/255 - k/255,0/255,0/255)
k = k + add
wait()
end
end

1 comment

0

jesus

This discussion is preserved as it was. New answers, comments, and votes are closed.