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
3 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:

local light3 = script.Parent.Parent.Parent.lights.Light1.Light3
local Spotlight = light3.SpotLight

while true do
    print("canBreak")
    wait(1)
    local CanBreak = math.random(1,10)
    if CanBreak == 3 then
        wait(1)
        Spotlight = Color3.new("Really black")
        Spotlight.Enabled = false
    end
end

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