Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local fMaxTimeBetweenPresses = 0.5
- local bIsOtherButtonPressed = false
- local bIsDoorOpen = true
- Buttons:EnableUsage()
- RunHandled(WaitForever,
- OnEvery(Event(Button01.Used)),function()
- if not bIsOtherButtonPressed then
- bIsOtherButtonPressed = true
- Wait(Delay(fMaxTimeBetweenPresses))
- bIsOtherButtonPressed = false
- else
- bIsDoorOpen = true
- worldInfo:ShowMessageToAll("DOOR OPENED")
- --CODE TO OPEN THE DOOR
- Wait(Delay(fMaxTimeBetweenPresses))
- end
- Button01:EnableUsage()
- end,
- OnEvery(Event(Button02.Used)),function()
- if not bIsOtherButtonPressed then
- bIsOtherButtonPressed = true
- Wait(Delay(fMaxTimeBetweenPresses))
- bIsOtherButtonPressed = false
- else
- bIsDoorOpen = true
- worldInfo:ShowMessageToAll("DOOR OPENED")
- --CODE TO OPEN THE DOOR
- Wait(Delay(fMaxTimeBetweenPresses))
- end
- Button02:EnableUsage()
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement