I want to make a button that turns on a command.
The command then repeats it self every 60 secs.
then I want to make a button that turns it off.
so far i have this. I just don't know how to turn it off
the script is:
local ticktimer
function reset_ticktimer()
if ticktimer then
killTimer(ticktimer)
end
ticktimer = tempTimer(1, function() increment_ticktimer(60) end)
end
function increment_ticktimer(time_left)
time_left = time_left - 1
if time_left == 40 then
send("break wall")
elseif time_left == 0 then
reset_ticktimer()
return
end
ticktimer = tempTimer(1, function() increment_ticktimer(time_left) end)
end
the button is
works well when i click button. But have no idea how to turn it off with another button. or can i use same button to turn off and on that changes red/green to say if its off or on?
any ideas?
Thanks