I want to toggle a boolean value if someone clicks a button. I got it to work that if they click it will go on and stay on for 2 minutes. But i would like to toggle the value if they click, not just turn it true for 2 minutes. Can someone help me please?
local toggle = game.Workspace.EmergencyLight.Toggle
script.Parent.mouseClick:connect(function()
toggle.Value = true
wait(120)
toggle.Workspace.EmergencyLight.Toggle.Value = false
end)

2 comments
You took your variable & combined it w/ it's information on line 6 lol; just simply change it to "toggle.Value" (line 6) and it'll work again. :)
The script above works. It's that i want it to be toggled instead of the wait