I’m writing a settings script, where if you click the parent of the script (button), it toggles Global Shadows.
The script only works until the “elseif” statement.
I tried seperating the if statement into two singular if statements, instead of using elseif, that didn’t do anything tho.
In the Output, there were also no warnings or anything regarding the script.
The script:
local button = script.Parent
local Lighting = game:GetService("Lighting")
local Activated = true
if Activated == true then
button.MouseButton1Click:Connect(function()
Lighting.GlobalShadows = false
Activated = false
end)
elseif Activated == false then
button.MouseButton1Click:Connect(function()
Lighting.GlobalShadows = true
Activated = true
end)
end
Any help is greatly appreciated, thanks!
PS: This is my first topic, so I’m open to receive feedback on what I could do better next time!