Scriptname aHH0ReturnTriggerScript extends ObjectReference  

Actor Property playerref Auto ; Least 'costly' way to refer to the player
Objectreference property aHH0ReturnSpotREF auto
Quest property aHH0 auto
Actor property creatureREF auto
Objectreference property SpawnRef auto
 
Event OnTriggerEnter(ObjectReference akActionRef)
	If akActionRef == PlayerREF ; This condition ensures that only the player will trigger this code
		Playerref.moveto(aHH0ReturnSpotREF)
		EvaluateReturn(1)
	EndIf
EndEvent

Function EvaluateReturn(int enq)
	aHHreturn += enq
	If aHHreturn >= 2 && aHH0.getstage() == 215
		debug.messagebox("that's useless, this void is bring me back everytime I try to reach the closet. There should be a way to disable it")
		aHH0.setstage(216)
	ElseIf aHHreturn >= 2 && aHH0.getstage() <= 200
		creatureREF.moveto(SpawnREF)
	EndIf
EndFunction

Int property aHHreturn auto