Jump to content

Need help with a script.


Recommended Posts

I need a script that is put on a door, 5 seconds after the door is opened, it gets closed automatically...

 

All i know is that i need a float timer, and using Getopenstate/setopenstate and disable commands. i just don't know how to put it all together.

Link to comment
Share on other sites

float timer

Begin OnActivate

set timer to 5
activate

End

Begin GameMode

If timer > 0
  set timer to timer - getsecondspassed
  return
elseif getopenstate == 1
  setopenstate 0
endif

End

 

If the door has a long animation, like the vault doors, the timer number may need to be higher to make sure it stays open for 5 seconds instead of closing as soon as the animation stops. Generally you would time the doors open animation and add 5, then set the timer to that. Untested but should work, providing I didn't make a typo.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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