Triggerbox Activates Trap All The Time - Stop It!

Post » Fri Apr 11, 2014 8:10 pm

I must have done this a 100 times successfully but I cannot work out why this is happening. I want a triggerbox to activate a spear trap (make bars go down at first and another triggerbox later makes them go up) once only. The trap is quite far from the triggerboxes so I'm consoling tfc to check. Here's what I've tried so far.

ObjectReference Property myLink Autoint DoOnceEvent OnTriggerLeave(objectreference akactionref)if DoOnce == 0if akactionref == game.getplayer()myLink.Activate(Game.GetPlayer())DoOnce == 1endifendifendevent

Then I thought the 2nd IF was irrelevant so I changed to...

ObjectReference Property myLink Autoint DoOnceEvent OnTriggerLeave(objectreference akactionref)if DoOnce == 0myLink.Activate(Game.GetPlayer())DoOnce == 1endifendevent

Both compile and do the job but the script remains active - every time the player leaves the triggerbox the trap activates (bars up or down accordingly). So I turned to States.

ObjectReference Property myLink AutoAuto State NotEnteredEvent OnTriggerLeave(objectreference akactionref)myLink.Activate(Game.GetPlayer())EndEvent  EndState

Same issue. Script is constantly active on the triggerbox, repeatedly activating the trap. Where am I going wrong?

Thanks.

User avatar
Jade
 
Posts: 3520
Joined: Mon Jul 10, 2006 6:42 am

Return to V - Skyrim

cron