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!
Correct me if I'm wrong but I'm pretty sure you need an If
statement before you can write elseif
Try this:
button.Clicked:connect(function() if lighting.GlobalShadows == false then local lighting = game.Lighting lighting.GlobalShadows = true elseif lighting.GlobalShadows == true then lighting.GlobalShadows = false end end)
If this helped make sure to accept the answer! if this didn't help, comment on it so I can attempt to figure out the problem!