Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @name Door Bunker
- @inputs Input Door:entity ValveOut:entity ValveIn:entity
- @outputs
- @persist X:angle Y Pitch Yaw SVolume Play Roll Input Ready State Block Anger Move [SoundCrank, SoundCrank2]:string Start
- if (first() | dupefinished()) { Move = 0 State = 0 }
- if (Input & Ready == 0) #If input and ready are 0, this executes
- {
- Ready = 1
- if ( State == 0) #If Ready and State is 0 (Closed) This executes
- {
- State = 1
- soundVolume(1, SVolume)
- timer("doorup",8000)
- entity():soundPlay(1, 0, SoundCrank)
- Block = 1
- URLN = 3
- Play = 1
- Anger = 0
- }
- if ( State == 0)
- {
- timer("valveunlock",10)
- }
- elseif ( State == 1)
- {
- State = 0
- soundVolume(1, SVolume)
- timer("valvelock",8000)
- timer("doordown",10)
- entity():soundPlay(1, 0, "doors/doormove7.wav")
- Block = 1
- URLN = 2
- Play = 1
- Anger = 0
- }
- elseif ( State == 1)
- {
- timer("valvelock",8000)
- }
- }
- if (clk("doorup"))
- {
- soundVolume(1, SVolume)
- timer("doorup",30)
- Door:setPos(Door:pos() + vec(0,0,+1.5))
- Move++
- if (Move == 71)
- {
- Ready = 0
- soundVolume(1, SVolume)
- soundStop(1)
- soundPlay(1, 0, "plats/bigstop1.wav")
- stoptimer("doorup")
- Move = 0
- }
- }
- if (clk("doorup"))
- {
- timer("doorup",30)
- ValveIn:setPos(ValveIn:pos() + vec(0,0,+1.5))
- ValveOut:setPos(ValveOut:pos() + vec(0,0,+1.5))
- }
- if (clk("valveunlock"))
- {
- timer("valveunlock",10)
- ValveIn:setAng(ValveIn:angles() + ang(0,0,+Move))
- ValveOut:setAng(ValveOut:angles() + ang(0,0,+Move))
- if (Move == 71)
- {
- soundVolume(1, SVolume)
- soundStop(1)
- soundPlay(1, 0, "plats/hall_elev_move.wav")
- stoptimer("valveunlock")
- Move = 0
- }
- }
- if (clk("doordown"))
- {
- soundVolume(1, SVolume)
- timer("doordown",30)
- Door:setPos(Door:pos() - vec(0,0,-1.5))
- ValveIn:setPos(ValveIn:pos() - vec(0,0,-1.5))
- ValveOut:setPos(ValveOut:pos() - vec(0,0,-1.5))
- Move++
- if (Move == 71)
- {
- Ready = 0
- soundVolume(1, SVolume)
- soundStop(1)
- soundPlay(1, 0, "plats/bigstop1.wav")
- stoptimer("doordown")
- Move = 0
- }
- }
- if (clk("valvelock"))
- {
- timer("valvelock",10)
- ValveIn:setAng(ValveIn:angles() + ang(0,0,-Move))
- ValveOut:setAng(ValveOut:angles() + ang(0,0,-Move))
- if (Move == 71)
- {
- soundVolume(1, SVolume)
- soundStop(1)
- soundPlay(1, 0, "plats/hall_elev_move.wav")
- stoptimer("valvelock")
- Move = 0
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement