ScriptName UCDoorScriptFloat TimerBegin OnLoad ; if the player left the door open the last time he was in here, close it. If GetOpenState == 1 SetOpenState 0 If GetLockLevel > 0 Lock EndIf EndIfEndBegin OnActivate Set Timer to 10 ActivateEndBegin GameMode If Timer > 0 Set Timer to Timer - GetSecondsPassed ElseIf GetOpenState == 1 SetOpenState 0 Set Timer to 0 If GetLockLevel > 0 Lock EndIf EndIf If GetOpenState == 3 Set Timer to 0 EndIfEnd