Jump to content

Automatic Door Script


falloutperson416

Recommended Posts

This is my own auto-close script (which is probably a reinvention of the wheel). I tend to think it better to let the player decide whether or not to open a door unless the door is part of a long run or series of regularly accessed doors. I've set it up to close automatically after a given time frame - which you can adjust from just one line. It is written in the context of not being a novelty - so no bleeping beeping noises:

 

scn zyzzSlAutoClose07

; automatically closes after 7 sec delay

Float T ; for Timer
Short D ; for Done

Begin OnActivate
Activate
Set T to 7
Set D to 1
End

Begin GameMode
If D == 1
If GetOpenState == 1
	If T <= 0
		Activate
		Set D to 0
	EndIf
	Set T to T - getSecondsPassed
EndIf
EndIf
End

 

For an auto door, you will need to place a trigger zone and link the trigger zone to the door under the activate parents tab. The auto-close will take care of the rest - although you may prefer to set a script o the trigger zone that activates the door on entry and separately on exiting the trigger zone. I vaguely remember doing something like this on an Oblivion mod...

 

I hope this helps...

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...