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

Why can't I edit Spotlight properties?

Asked by
lukedm 0
4 years ago

I have this script which is supposed to turn the lights off by either making the brightness 0 or disabling it. Here is the script I have written:

01local light3 = script.Parent.Parent.Parent.lights.Light1.Light3
02local Spotlight = light3.SpotLight
03 
04while true do
05    print("canBreak")
06    wait(1)
07    local CanBreak = math.random(1,10)
08    if CanBreak == 3 then
09        wait(1)
10        Spotlight = Color3.new("Really black")
11        Spotlight.Enabled = false
12    end
13end

The script was edited for this question to show the variable and how it is edited. The Color3 does work but the Spotlight.Enabled = false doesn't work. I can put the whole script if it would help, thanks.

Answer this question