Advertisement
Mudbill

Lever Puzzles Script (Amnesia)

May 20th, 2013
1,310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. void OnStart()
  2. {
  3. AddEntityCollideCallback("Handle", "AreaConnect", "AttachLever", true, 1);
  4. }
  5.  
  6. void AttachLever(string &in asParent, string &in asChild, int alState)
  7. {
  8. SetEntityActive("Lever", true);
  9. PlaySoundAtEntity("", "pickaxe_charge.snt", "Lever", 0, false);
  10. SetEntityActive(asParent, false);
  11. SetEntityActive("Mount", false);
  12. }
  13.  
  14. void UnlockDoor(string &in asEntity, int LeverState)
  15. {
  16. if(LeverState == 1) {
  17. SetSwingDoorLocked("Door", false, true);
  18. PlaySoundAtEntity("", "unlock_door.snt", "Door", 0, false);
  19. SetLeverStuckState(asEntity, LeverState, true);
  20. }
  21. }
  22.  
  23. void Puzzle(string &in asEntity, int LeverState)
  24. {
  25. if(GetLeverState("Lever1") == -1
  26. && GetLeverState("Lever2") == 1)
  27. {
  28. SetPropHealth("Door", 0);
  29. SetLeverStuckState("Lever1", -1, true);
  30. SetLeverStuckState("Lever2", 1, true);
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement