Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @name RDC Submarine Water Depth Thingy V1.1
- @inputs Up Down Base:entity Seat:entity
- @outputs Depth
- @persist Depth Scale WaterHeight CrushDepth CanChangeDepth
- @trigger
- interval(100)
- if(first()|dupefinished())
- {
- Scale=10
- CrushDepth=200
- #timer("CheckDepth",5000)
- WaterHeight=entity():pos():z()
- CanChangeDepth=1
- CrushDepth*=39.37
- }
- #if(clk("CheckDepth"))
- #{
- rangerHitWater(1)
- rangerHitEntities(0)
- WaterRanger=rangerOffset(8000,Base:pos()+vec(0,0,4000),vec(0,0,-1))
- timer("CheckDepth",5000)
- #}
- #(AvgHeight/LegCount)+vec(0,0,HoverHeight)-entity():pos()
- Base:applyForce(((((WaterRanger:position()-vec(0,0,Depth)-Base:pos()))-Base:vel())*Base:mass())*vec(0,0,1)+Base:vel()*vec(0,0,-0.2)*Base:mass())
- if(~Down&Down&CanChangeDepth)
- {
- CanChangeDepth=0
- Depth=clamp(Depth+39.37,0,4800)
- if(Depth>CrushDepth)
- {
- Boom=propSpawn("models/props_junk/propane_tank001a.mdl",(Base:toWorld(vec(0,0,-5))),(Base:toWorld(ang(90,0,0))),0)
- Boom:propBreak()
- Base:propDelete()
- }
- Seat:printDriver("Target Depth: "+Depth/39.37*Scale)
- if(changed(Depth))
- {
- Base:soundPlay("AdjustSpeed", 0, "acf_extra/vehiclefx/trans/default_shift.wav")
- soundVolume("AdjustSpeed",1)
- soundPitch("AdjustSpeed",80)
- }
- timer("DepthChange",500)
- }
- elseif(~Up&Up&CanChangeDepth)
- {
- CanChangeDepth=0
- Depth=clamp(Depth-39.37,0,4800)
- if(Depth>CrushDepth)
- {
- Boom=propSpawn("models/props_junk/propane_tank001a.mdl",(Base:toWorld(vec(0,0,-5))),(Base:toWorld(ang(90,0,0))),0)
- Boom:propBreak()
- Base:propDelete()
- }
- Seat:printDriver("Target Depth: "+Depth/39.37*Scale)
- if(changed(Depth))
- {
- Base:soundPlay("AdjustSpeed", 0, "acf_extra/vehiclefx/trans/default_shift.wav")
- soundVolume("AdjustSpeed",1)
- soundPitch("AdjustSpeed",80)
- }
- timer("DepthChange",500)
- }
- if(clk("DepthChange"))
- {
- stoptimer("DepthChange")
- CanChangeDepth = 1
- }
Add Comment
Please, Sign In to add comment