Scriptname zzzTrapDoorMisicScript extends ObjectReference  

Activator property activatorToPlace auto

float yRot
float zRot
float curX
float curY
float curZ

Event OnLoad()
	BlockActivation()
EndEvent

Event OnActivate(ObjectReference activator)
	If Game.GetPlayer().IsSneaking() == True
		yRot = GetAngleY()
		zRot = GetAngleZ()
		curX = GetPositionX()
		curY = GetPositionY()
		curZ = Game.GetPlayer().GetPositionZ()
		
		ObjectReference toPlace = Self.PlaceAtMe(activatorToPlace)
		
		toPlace.SetPosition(curX, curY, curZ)
		toPlace.setAngle(0, yRot, zRot)
		
		Delete()
	Else
		Game.GetPlayer().AddItem(Self, 1)
	EndIf
EndEvent