XaselmTRAPFloorSCRIPT
Editor ID:XaselmTRAPFloorSCRIPT
Form ID:00054B5C
Typ:Objekt
Script:scn XaselmTRAPFloorSCRIPT
float timer
ref mySelf
ref myParent
short init
short triggered
short busy
short next
begin onActivate
set mySelf to getSelf
set myParent to getParentRef
if triggered == 0 && isActionRef player == 0
if busy == 0
playgroup forward 0
set triggered to 1
set busy to 1
set timer to 5
set next to 1
endif
elseif triggered == 1 && isActionRef player == 0
if busy == 0
playgroup backward 0
set timer to 2
set busy to 1
endif
endif
end
begin gameMode
if timer > 0
set timer to timer - getSecondsPassed
endif
if next == 1 && triggered == 1 && timer <= 1
myParent.activate mySelf 1
set next to 0
endif
if busy == 1 && isAnimPlaying == 0 && timer <= 0
set busy to 0
endif
if init == 0
set mySelf to getSelf
set myParent to getParentRef
set init to 1
endif
end