Okay, I have it working, but I'm CERTAIN it could be much cleaner with smarter scripting, as my method uses two timers, three counters, and a script
- create two buttons and a door (named
hurrybutton1,
hurrybutton2, and
hurrydoor)
- create two timers (one near each button)(named
hurrytimer1 and
hurrytimer2)
- create three counters (two for the buttons named
hurrycounter1 and
hurrycounter2, and one for the door named
hurrycounterdoor)
- create a script nearby (named
hurryscript)
hurryscript:
Code: Select all
function hurry1()
hurrycounter1:setValue(0)
end
function hurry2()
hurrycounter2:setValue(0)
end
(this allows spamming of the buttons to have no ill effect, as the counters will just keep getting set to 0)
- set your timers to give enough time to traverse the room
- set
hurrycounter1 and 2 to "
1" and hurrycounterdoor to "
2"
CONNECTIONS:
- connect each button to its corresponding timer with "
activate"
- connect each button to
hurryscript, with corresponding "
hurry1" and "
hurry2"
- connect
hurrytimer1 to all three counters with "
reset", and connect it to itself with "
deactivate"
- connect
hurrytimer2 to all three counters with "
reset", and connect it to itself with "
deactivate"
- connect the two counters to
hurrycounterdoor with
activate -
decrement
- connect
hurrycounterdoor to
hurrydoor with
activate -
open
When a button is pushed, its timer starts and its counter is temporarily set to 0 (which in turn decrements the door counter by 1). This lasts for a few seconds, and if the other button isn't pushed soon enough then the first timer will reset all the counters. But if the other button IS pushed soon enough, then its counter is also set to 0, which decrements the door counter down to 0, opening the door permanently.
I can't make it break, so it seems to work pretty foolproof for me so far