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

How does one make spot light change color?

I am trying to make a spotlight that changes color as well as having a working light. Don't know how to change the spotlight color. Thanks!

2 answers

go inside the Spotlight properties and change the color by pressing on the color pallet and changing the color from there or if you want to do it with a script put a server script inside the Spotlight and put this inside the script :

local Spotlight = script.Parent

Spotlight.Color = Color3.fromRGB(25,25,25) -- Numbers represent color values

or if you want to randomize if you can do

local Spotlight = script.Parent

game:GetService("RunService").Stepped:Connect(function()
      Spotlight.Color = Color3.fromRGB(math.random(),math.random(),math.random)
end)

Hello. To change SpotLight color go to:

SpotLight » Properties » Color

To change it with a Script use:

SpotLight = script.Parent.SpotLight

SpotLight.Color = Color3.fromRGB(0,0,0)

Here is a Script to change the color.

SpotLight = script.Parent.SpotLight

while wait(0.1) do
	Number1 = math.random(1,999)
	Number2 = math.random(1,999)
	Number3 = math.random(1,999)
	SpotLight.Color = Color3.fromRGB(Number1,Number2,Number3)
end

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