Robinsage Posted February 17, 2013 Share Posted February 17, 2013 Basically - Is there a script that will stop a timer from running? Specifically - I enter trigger box A, it does something, and when I leave it sets a timer for an event to happen after 60 seconds. I enter trigger box B while the timer from trigger box A is still counting. The event from trigger box A will occur while I'm still standing in trigger box B, which I don't want to happen. So I'm looking for a way to stop the timer in box A from running when I enter box B. I can't find a solution anywhere =\ Thanks for any help! =) Link to comment Share on other sites More sharing options...
ScottyDoesKnow Posted February 18, 2013 Share Posted February 18, 2013 I haven't done any coding with trigger boxes, but would it be possible to check if you're in box B from the event of box A? Then you don't need to cancel it. Link to comment Share on other sites More sharing options...
Ghaunadaur Posted February 18, 2013 Share Posted February 18, 2013 There are probably many ways to do this. You could send an activate event from trigger B to trigger A to stop the timer. Place this script on trigger A: Scriptname TriggerAScript extends ObjectReference Event OnTriggerEnter(ObjectReference akActionRef) if akActionRef == Game.GetPlayer() ; do something endif EndEvent Event OnTriggerLeave(ObjectReference akActionRef) if akActionRef == Game.GetPlayer() RegisterForSingleUpdate(60) ; prepare to do something after 60 seconds endif EndEvent Event OnUpdate() ; after 60 seconds, do this EndEvent Event OnActivate(ObjectReference akActionRef) UnregisterForUpdate() ; if activated by trigger B, stop timer EndEvent On trigger B, put this script: Scriptname TriggerBScript extends ObjectReference Event OnTriggerEnter(ObjectReference akActionRef) if akActionRef == Game.GetPlayer() Activate(self) endif EndEvent For trigger A, choose trigger B as activate parent. This way you don't even need a property. Link to comment Share on other sites More sharing options...
Robinsage Posted February 18, 2013 Author Share Posted February 18, 2013 Thank you for the replies, they are very helpful. Link to comment Share on other sites More sharing options...
Recommended Posts