SHARE
TWEET

Door code test 7

a guest Aug 22nd, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @name Door Bunker
  2. @inputs Input Door:entity ValveOut:entity ValveIn:entity
  3. @outputs
  4. @persist X:angle Y Pitch Yaw SVolume Play Roll Input Ready State Block Anger Move [SoundCrank, SoundCrank2]:string Start
  5. if (first() | dupefinished()) { Move = 0 State = 0 }
  6. if (Input & Ready == 0) #If input and ready are 0, this executes
  7. {
  8. Ready = 1
  9. if ( State == 0) #If Ready and State is 0 (Closed) This executes
  10. {
  11. State = 1
  12. soundVolume(1, SVolume)
  13. timer("doorup",8000)
  14. entity():soundPlay(1, 0, SoundCrank)
  15. Block = 1
  16.  
  17. URLN = 3
  18. Play = 1
  19. Anger = 0
  20. }
  21. if ( State == 0)
  22. {
  23. timer("valveunlock",10)
  24. }
  25. elseif ( State == 1)
  26. {
  27. State = 0
  28. soundVolume(1, SVolume)
  29. timer("valvelock",8000)
  30. timer("doordown",10)
  31. entity():soundPlay(1, 0, "doors/doormove7.wav")
  32. Block = 1
  33. URLN = 2
  34. Play = 1
  35. Anger = 0
  36. }
  37. elseif ( State == 1)
  38. {
  39. timer("valvelock",8000)
  40. }
  41. }
  42. if (clk("doorup"))
  43. {
  44. soundVolume(1, SVolume)
  45. timer("doorup",30)
  46. Door:setPos(Door:pos() + vec(0,0,+1.5))
  47. Move++
  48.  
  49. if (Move == 71)
  50. {
  51. Ready = 0
  52. soundVolume(1, SVolume)
  53. soundStop(1)
  54. soundPlay(1, 0, "plats/bigstop1.wav")
  55. stoptimer("doorup")
  56. Move = 0
  57. }
  58. }
  59. if (clk("doorup"))
  60. {
  61. timer("doorup",30)
  62. ValveIn:setPos(ValveIn:pos() + vec(0,0,+1.5))
  63. ValveOut:setPos(ValveOut:pos() + vec(0,0,+1.5))
  64. }
  65. if (clk("valveunlock"))
  66. {
  67. timer("valveunlock",10)
  68. ValveIn:setAng(ValveIn:angles() + ang(0,0,+Move))
  69. ValveOut:setAng(ValveOut:angles() + ang(0,0,+Move))
  70. if (Move == 71)
  71. {
  72. soundVolume(1, SVolume)
  73. soundStop(1)
  74. soundPlay(1, 0, "plats/hall_elev_move.wav")
  75. stoptimer("valveunlock")
  76. Move = 0
  77. }  
  78. }
  79.  
  80. if (clk("doordown"))
  81. {
  82. soundVolume(1, SVolume)
  83. timer("doordown",30)
  84. Door:setPos(Door:pos() - vec(0,0,-1.5))
  85. ValveIn:setPos(ValveIn:pos() - vec(0,0,-1.5))
  86. ValveOut:setPos(ValveOut:pos() - vec(0,0,-1.5))
  87. Move++
  88.  
  89. if (Move == 71)
  90. {
  91. Ready = 0
  92. soundVolume(1, SVolume)
  93. soundStop(1)
  94. soundPlay(1, 0, "plats/bigstop1.wav")
  95. stoptimer("doordown")
  96. Move = 0
  97. }
  98. }
  99. if (clk("valvelock"))
  100. {
  101. timer("valvelock",10)
  102. ValveIn:setAng(ValveIn:angles() + ang(0,0,-Move))
  103. ValveOut:setAng(ValveOut:angles() + ang(0,0,-Move))
  104. if (Move == 71)
  105. {
  106. soundVolume(1, SVolume)
  107. soundStop(1)
  108. soundPlay(1, 0, "plats/hall_elev_move.wav")
  109. stoptimer("valvelock")
  110. Move = 0
  111. }
  112. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top