How do you get a trigger to trigger just once ?
I want it to trigger once each time a player runs into it but every thing i do just keeps triggering as long as the player is in the trgger area or just works once and not for the next player.
cant be use
trigger once
Moderator: Moderators
-
Rookie One.pl
- Site Admin
- Posts: 2752
- Joined: Fri Jan 31, 2003 7:49 pm
- Location: Nowa Wies Tworoska, Poland
- Contact:
Use a trigger_once entity (it's exactly the same as trigger_multiple but gets removed after it's triggered) or execute the nottriggerable command on it after it gets triggered. The triggerable command makes it usable again.
Example:
Example:
Code: Select all
trigger_triggered:
self nottriggerable // disable the trigger
wait 5
self triggerable // enable the trigger again after 5 secsIf you want to do it while a player in in the trigger , I mean for another player you can do it like this assumeing the thread is run by setting the setthread key on the trigger
trigger_thread:
local.player = parm.other
if(local.player.intrigger != NIL)
end
local.player.intrigger = 1
// do your stuff here
while(local.player istouching self)
waitframe
local.player.intrigger = NIL
end
Also you can set a wait on the trigger
"wait" ( Float wait_time ) Set the wait time (time between triggerings) for this trigger
trigger_thread:
local.player = parm.other
if(local.player.intrigger != NIL)
end
local.player.intrigger = 1
// do your stuff here
while(local.player istouching self)
waitframe
local.player.intrigger = NIL
end
Also you can set a wait on the trigger
"wait" ( Float wait_time ) Set the wait time (time between triggerings) for this trigger


