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

How do i make all spotlights same colors?

iMM trying to make it so all spotlight beams have the same color instead of each beam rainbow flashing at different colors. how can this script color change all the beams at same color, same speed sorry if this is hard to explain i just want all the spotlights in my folder on studio workspace to match rainbow colors

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

2 answers

Choose 1 spot light will be the main spot light and put the script you made inside that Main spotlight now for other spotlight you only need to make a script that will copy the color of the main spotlight

local MainSpotLight = workspace.spotlight:FindFirstChild("SpotLight_1).Light -- Let say this is your main Spot light, rename the Light if needed or delete it
while true do
    script.Parent.Color =MainSpotLight.Color -- This will copy the color if the MainSpotLight
    wait(1)
end

2 comments

0

well i have a folder in worskapce called "spotlights" and in that folder is my model "Spotlight_1" and "Spotlight_2" in those models is a beam light and in that beam ive put a script in so how should i do it

0

Ok i will edit my answer

Try putting this in the spotlights folder

local Spotlights = script.Parent

while true do
	local RandomColor = Color3.new(math.random(),math.random(),math.random())
   	for _, light in pairs(Spotlights:GetChildren()) do
		light.Beam.Color = ColorSequence.new(RandomColor, RandomColor)
	end
	wait(1)
end

6 comments

0

well my script that i shwown was om the "beam"

0

my script is located in the beam*

0

does it have to be located in the beam?

0

ye

0

then you could just change the first line to Spotlights = script.Parent.Parent.Parent.Parent since that points to the spotlight folder as far as i understand

0

i think its supposed to be one less Parent's, but you get the idea

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