Advertisement
Mudbill

Automatically Open Doors Script (Amnesia)

Sep 15th, 2013
1,088
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. void OnStart()
  2. {
  3. AddEntityCollideCallback("Player", "AreaDoor", "EventDoor", true, 1);
  4. }
  5.  
  6. void EventDoor(string &in asParent, string &in asChild, int alState)
  7. {
  8. SetSwingDoorClosed("Door", false, false);
  9. SetSwingDoorDisableAutoClose("Door", true);
  10.  
  11. PlaySoundAtEntity("creak", "joint_door_move_special.snt", "Door", 1, false);
  12.  
  13. AddTimer("", 2, "TimerStopSound");
  14. AddTimer("Door", 0, "TimerMoveDoor");
  15. }
  16.  
  17. void TimerMoveDoor(string &in asTimer)
  18. {
  19. if(GetLocalVarInt("VarDoor") == 10) return;
  20. AddLocalVarInt("VarDoor", 1);
  21.  
  22. AddTimer(asTimer, 0.03, "TimerMoveDoor");
  23.  
  24. AddPropForce(asTimer, -70, 0, 0, "world");
  25. }
  26.  
  27. void TimerStopSound(string &in asTimer)
  28. {
  29. StopSound("creak", 0.4);
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement