I'm making a plugin to disable/enable global shadows. I cut off the plugin part so that people won't steal. Here is my script:
button.Clicked:connect(function()
local lighting = game.Lighting
lighting.GlobalShadows = true
elseif lighting.GlobalShadows == true then
lighting.GlobalShadows = false
end
end)
the problem is it underlines elseif in red and says that it needs an end to close the function at line 8 (1 in this script). I put 2 ends (as you see). But it still says that it needs an end. I added like 100 ends but it still underlines elseif in red. Could anyone fix this?
Thanks for reading!

2 comments
I deleted line 3 and put it into line 2 and made the previous line 2 to line 3. When I uploaded it, it showed up, but when I clicked it did nothing. I went back and did it your way but nothing happened.
You should set the 'lighting' variable to global if you're going to use it on the 'if' and 'elseif' statement. Otherwise, add another 'lighting' and its assignment under 'elseif' and write out the whole name for 'lighting' in the 'if' and 'elseif' statement (game.Lighting.GlobalShadows...)