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

How does one make spot light change color?

Asked by 5 years ago

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

Log in to vote
0
Answered by
F_F 53
5 years ago

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)
Ad
Log in to vote
0
Answered by
JakyeRU 637 Moderation Voter
5 years ago

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

Answer this question