say i want a door to open and close when i clicked it...how would i get it to go back and forth on each click?
Just create a variable and check if it is true or false.
local opened = false if opened == false then opened = true --open door elseif opened == true then opened = false --close door end
That's the basic logic of it, hope i helped!