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

How do I make this script work?

Asked by 8 years ago
local Enabled = true
local part = script.Parent
local spotlight = game.Lighting.GlobalShadows

script.Parent.ClickDetector.MouseClick:connect(function()
    Enabled = not Enabled
    spotlight.Enabled = Enabled
end)

output message reads: 21:38:58.529 - Workspace.Part.Script:7: attempt to index upvalue 'spotlight' (a boolean value)

i have no clue how to fix that

Answer this question