Night_Wolf17

ScoutW

Mar 30th, 2022
679
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 11.91 KB | None | 0 0
  1. @name ScoutW
  2. @inputs
  3. @outputs
  4. @persist [E Dri Seat P1 P2]:entity U Mode
  5. @trigger
  6. @model models/hunter/blocks/cube075x075x025.mdl
  7.  
  8.     # # # # # # # # # # # # # # # # # # # # # # # # #
  9.     #           BY ARKiSS 19.10.2021                #
  10.     # # # # # # # # # # # # # # # # # # # # # # # # #
  11.        
  12.     O = owner()
  13.     Z = O:keyPressed("z")
  14.     Dri = Seat:driver()
  15.     W = Dri:keyForward()
  16.     S = Dri:keyBack()
  17.     A = Dri:keyLeft()
  18.     D = Dri:keyRight()
  19.     Space = Dri:keyJump()
  20.     Alt = Dri:keyWalk()
  21.     M1 = Dri:keyAttack1()
  22.    
  23.     interval(10)
  24.    
  25.     if(first())
  26.     {
  27.         E = entity()
  28.         E:setAlpha(0)
  29.         E:setMass(100)
  30.         E:propGravity(0)
  31.        
  32.         E["Health",number]  = 100
  33.         E["Speed",number] = 250
  34.        
  35.         if(!Seat)
  36.         {
  37.             Seat = seatSpawn("models/nova/airboat_seat.mdl",0)
  38.             Seat:setPos(E:toWorld(vec(-5,0,5)))
  39.             Seat:setAng(E:toWorld(ang(0,-90,0)))
  40.             Seat:setMass(0)                
  41.             Seat:setMaterial("phoenix_storms/concrete1")
  42.             Seat:setColor(vec(40))    
  43.         }  
  44.         timer("parent",300)
  45.  
  46.         function void holo(I:number,P:vector,S:vector,C:vector,M:string,Ent:entity)
  47.         {
  48.             holoCreate(I)
  49.             holoPos(I,P)
  50.             holoScale(I,S)
  51.             holoColor(I,C)
  52.             holoModel(I,M)
  53.             holoParent(I,Ent)
  54.         }
  55.        
  56.         holo(1,E:toWorld(vec(-120,6.8,2)),vec(0.8,0.9,1.0),vec(40),"models/xqm/jetbody3_s2.mdl",E)
  57.         holoClipEnabled(1,1)
  58.         holoClip(1,vec(0,-10,0),vec(0,-1,0),0)
  59.         holoAng(1,E:toWorld(ang(0,90,0)))
  60.  
  61.         holo(2,E:toWorld(vec(-139,0.5,3)),vec(2.4,4.9,1.7),vec(40),"models/mechanics/robotics/d1.mdl",E)
  62.         holoAng(2,E:toWorld(ang(0,90,0)))
  63.         #holoMaterial(2,"models/shiny")
  64.         holoEntity(2):setSubMaterial(2,"models/segment/segment_skin")
  65.        
  66.         holo(3,E:toWorld(vec(-145,0.5,23)),vec(1.7,4.5,2.3),vec(20),"models/mechanics/robotics/g1.mdl",E)
  67.         holoAng(3,E:toWorld(ang(0,90,0)))
  68.         holoMaterial(3,"models/segment/segment_skin")
  69.        
  70.         holo(4,E:toWorld(vec(-171,16.5,3)),vec(0.755,0.7,1.4),vec(100),"models/xqm/afterburner1medium.mdl",E)
  71.         holoAng(4,E:toWorld(ang(0,90,-90)))
  72.  
  73.         holo(5,E:toWorld(vec(-171,-16.5,3)),vec(0.755,0.7,1.4),vec(100),"models/xqm/afterburner1medium.mdl",E)
  74.         holoAng(5,E:toWorld(ang(0,90,-90)))
  75.  
  76.         holo(6,E:toWorld(vec(-100,0,0.8)),vec(4.5,6.4,2.65),vec(10),"hq_sphere",E)
  77.         holoMaterial(6,"models/segment/segment_skin")
  78.         holoDisableShading(6,1)
  79.  
  80.         holo(7,E:toWorld(vec(-60,61,5)),vec(3.5,2.5,2.5),vec(30),"models/xqm/jettailpiece1.mdl",E)
  81.         holoAng(7,E:toWorld(ang(90,90,0)))
  82.         holoMaterial(7,"models/segment/segment_skin")
  83.        
  84.         holo(8,E:toWorld(vec(-60,-61,5)),vec(3.5,2.5,2.5),vec(30),"models/xqm/jettailpiece1.mdl",E)
  85.         holoAng(8,E:toWorld(ang(-90,90,0)))
  86.         holoMaterial(8,"models/segment/segment_skin")
  87.        
  88.         # # # # # # # # # # # # # # # # INTERFACE # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
  89.         holo(9,E:toWorld(vec(42,0,15)),vec(3,2.85,2),vec(30),"hq_sphere",E)
  90.         holoMaterial(9,"models/segment/segment_skin")    
  91.            
  92.         holo(10,E:toWorld(vec(-55,0,28.7)),vec(0.4,0.45,0.8),vec(255),"models/props_combine/masterinterface.mdl",E)
  93.         holoAng(10,E:toWorld(ang(265,-180,0)))
  94.         holoClipEnabled(10,1)
  95.         holoClip(10,vec(-10,0,0),vec(1,0,0),0)  
  96.        
  97.         soundPlay("forw",0,"thrusters/rocket00.wav")  
  98.  
  99.         holo(11,E:toWorld(vec(18,0,23)),vec(0.5),vec(0),"models/sprops/trans/misc/gauge_3.mdl",E)
  100.         holoAng(11,E:toWorld(ang(-60,180,0)))
  101.         holoSkin(11,4)
  102.  
  103.         holoCreate(12,E:toWorld(vec(17.5,0,23.5)))
  104.         holoScale(12,vec(0.02))
  105.         holoColor(12,vec(155,0,0))
  106.         holoModel(12,"hq_sphere")
  107.         holoAng(12,E:toWorld(ang(60,0,-180)))
  108.         holoParent(12,E)
  109.  
  110.         holoCreate(13,holoEntity(12):toWorld(vec(0,0,1.3)))
  111.         holoScale(13,vec(0.005,0.005,0.2))
  112.         holoColor(13,vec(155,0,0))
  113.         holoAng(13,holoEntity(12):toWorld(ang(0,0,0)))
  114.         holoParent(13,12)
  115.         # # # # # # # # # # # # # # # # EFFECT # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
  116.         holo(14,E:toWorld(vec(-150.5,18,0)),vec(0.3,0.3,0.4),vec(255),"models/effects/vol_light64x256.mdl",E)
  117.         holoAng(14,E:toWorld(ang(0,-90,-90)))  
  118.  
  119.         holo(15,E:toWorld(vec(-150.5,-16,0)),vec(0.3,0.3,0.4),vec(255),"models/effects/vol_light64x256.mdl",E)
  120.         holoAng(15,E:toWorld(ang(0,-90,-90)))
  121.  
  122.         holo(16,E:toWorld(vec(-150.5,18,0)),vec(0.4,0.4,0.3),vec(255),"models/effects/vol_light64x256.mdl",E)
  123.         holoAng(16,E:toWorld(ang(0,-90,-90)))  
  124.  
  125.         holo(17,E:toWorld(vec(-150.5,-16,0)),vec(0.4,0.4,0.3),vec(255),"models/effects/vol_light64x256.mdl",E)
  126.         holoAng(17,E:toWorld(ang(0,-90,-90)))
  127.        
  128.         holo(18,holoEntity(7):toWorld(vec(-2,-22,-15)),vec(2,1,1),vec(255),"models/weapons/w_mach_m249para.mdl",holoEntity(7))
  129.         holoAng(18,holoEntity(7):toWorld(ang(0,-90,270)))
  130.  
  131.         holo(19,holoEntity(8):toWorld(vec(2,-22,-15)),vec(2,1,1),vec(255),"models/weapons/w_mach_m249para.mdl",holoEntity(8))
  132.         holoAng(19,holoEntity(8):toWorld(ang(0,-90,90)))
  133.  
  134.         holo(20,E:toWorld(vec(25,0,42)),vec(1,1,1),vec(255),"hq_cube",E)
  135.         holoAlpha(20,120)
  136.         holoColor(20,vec(255,255,0))
  137.         holoAng(20,E:toWorld(ang(0,-90,90)))
  138.        
  139.        
  140.         holo(21,E:toWorld(vec(25,3,42.7)),vec(0.05),vec(255),"models/sprops/misc/alphanum/alphanum_h.mdl",E)
  141.         holoAng(21,E:toWorld(ang(0,-90,0)))
  142.         holoAlpha(21,120)
  143.         holoColor(21,vec(255,255,0))
  144.  
  145.         holo(22,E:toWorld(vec(25,2,42.7)),vec(0.05),vec(255),"models/sprops/misc/alphanum/alphanum_p.mdl",E)
  146.         holoAng(22,E:toWorld(ang(0,90,0)))
  147.         holoAlpha(22,120)
  148.         holoColor(22,vec(255,255,0))
  149.  
  150.         holo(23,E:toWorld(vec(25,1.5,42.7)),vec(0.05),vec(255),"models/sprops/misc/alphanum/alphanum_colon.mdl",E)
  151.         holoAng(23,E:toWorld(ang(0,90,0)))
  152.         holoAlpha(23,120)
  153.         holoColor(23,vec(255,255,0))
  154.  
  155.         holo(24,E:toWorld(vec(-5,1.5,20)),-vec(5,7,5),vec(200,0,0),"hq_sphere",E)
  156.         holoAng(24,E:toWorld(ang(0,90,0)))
  157.         holoAlpha(24,0)
  158.                
  159.         holoDisableShading(20,1)
  160.         holoDisableShading(21,1)
  161.         holoDisableShading(22,1)
  162.         holoDisableShading(23,1)
  163.         holoDisableShading(24,1)
  164.              
  165.         P1 = propSpawn("models/hunter/blocks/cube075x075x025.mdl",holoEntity(7):toWorld(vec(0,0,0)),holoEntity(7):toWorld(ang(90,0,0)),0)
  166.         P2 = propSpawn("models/hunter/blocks/cube075x075x025.mdl",holoEntity(8):toWorld(vec(0,0,0)),holoEntity(8):toWorld(ang(90,0,0)),0)
  167.            
  168.             P1:setMass(0)     P2:setMass(0)
  169.             P1:setParent(E)   P2:setParent(E)
  170.             holoParent(7,P1)
  171.             holoParent(8,P2)
  172.             P1:setAlpha(0)    P2:setAlpha(0)
  173.            
  174.             Mode = 1
  175.     }
  176.  
  177.  
  178. # # # # # # # # # # # # # # # # ENGiNE PART # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
  179.         holoVisible(20,players(),0)
  180.         holoVisible(21,players(),0)
  181.         holoVisible(22,players(),0)
  182.         holoVisible(23,players(),0)
  183.         holoVisible(24,players(),0)
  184.        
  185.         holoVisible(20,Seat:driver(),1)
  186.         holoVisible(21,Seat:driver(),1)
  187.         holoVisible(22,Seat:driver(),1)
  188.         holoVisible(23,Seat:driver(),1)
  189.         holoVisible(24,Seat:driver(),1)
  190.  
  191.     if(Mode == 1)
  192.     {
  193.         applyForce(E:forward()*((W-S) * E["Speed",number]*20) - E:toWorldAxis(E:velL() * vec(0.015,0.5020125,0.245))*E:mass())
  194.         applyForce(E:up()*E:mass()*20*(Space-Alt)*10)
  195.        
  196.         holoScaleUnits(20,vec(E["Health",number]/10,0.3,0.3))
  197.         if(E["Health",number]<=50){ holoColor(20,vec(0,255,0)) }
  198.         if(E["Health",number]<=25){ holoColor(20,vec(255,0,0)) }            
  199.        
  200.         rangerFilter(Seat)
  201.         rangerFilter(E)
  202.         rangerFilter(players())
  203.         DW = rangerOffset(30,E:pos(),-E:up())
  204.         if(DW:hit()){ applyForce(E:up()*80*E:mass())}
  205.         Y=vec(Dri:eye():dot(E:right()),Dri:eye():dot(E:right()),0):y()
  206.         P=vec(0,Dri:eye():dot(E:up()),Dri:eye():dot(E:up())):z()
  207.        
  208.         applyAngForce(ang(-P,-Y,(D-A))*100*E:mass()-E:angVel()*E:mass())
  209.  
  210.  
  211.         if(E:getDamage())
  212.         {
  213.             E["Health",number] = E["Health",number] - 1
  214.             holoAlpha(24,150)
  215.         }else{timer("lat",100)}
  216.         if(clk("lat")){ holoAlpha(24,0) stoptimer("lat")}
  217.  
  218.         if(W)
  219.         {
  220.             U++
  221.             particleBounce(0)
  222.             particleGravity(vec())
  223.             #particle(1,20,0,"particle/warp1_warp",vec(255),holoEntity(14):pos(),vec())
  224.             particle(0.3,22,0,"particle/warp1_warp",vec(255),holoEntity(14):pos(),vec(),0,0,255,0)
  225.             particle(0.3,22,0,"particle/warp1_warp",vec(255),holoEntity(15):pos(),vec(),0,0,255,0)
  226.             #particle(1,20,0,"particle/warp1_warp",vec(255),holoEntity(15):pos(),vec())
  227.         }
  228.         else{ U-- }
  229.        
  230.         if(U>=5){ U=5 } if(U<=0){ U = 0 }
  231.    
  232.         holoAlpha(14,U)
  233.         holoAlpha(15,U)
  234.         holoAlpha(16,U)
  235.         holoAlpha(17,U)
  236.    
  237.         holoAng(14,E:toWorld(ang(-curtime()*1000,-90,-90)))
  238.         holoAng(15,E:toWorld(ang(curtime()*1000,-90,-90)))
  239.        
  240.         if(E:velL():x()>=0)
  241.         {
  242.             holoAng(12,E:toWorld(ang(60,0,-180+clamp(E:velL():x()/3.15,0,320))))
  243.         }
  244.         if(E:velL():x()<0)
  245.         {
  246.             holoAng(12,E:toWorld(ang(60,0,-180+clamp(-E:velL():x()/3.15,0,320))))
  247.         }        
  248.        
  249.         if(M1)
  250.         {
  251.             timer("atk",200)
  252.         }
  253.         if(clk("atk"))
  254.         {
  255.             holoEntity(18):shootTo(holoEntity(18):pos(),holoEntity(18):forward(),0,90,50,"HelicopterTracer")
  256.             holoEntity(19):shootTo(holoEntity(19):pos(),holoEntity(19):forward(),0,90,50,"HelicopterTracer")
  257.             soundPlay("atk",0,"weapons/alyx_gun/alyx_gun_fire6.wav")
  258.         }
  259.         soundPitch("forw",abs(E:velL():x())/1.5*0.1+40)
  260.     }
  261.     else
  262.     {
  263.         holoAlpha(14,0)
  264.         holoAlpha(15,0)
  265.         holoAlpha(16,0)
  266.         holoAlpha(17,0)        
  267.     }
  268.             if(E["Health",number]<=0)
  269.             {
  270.                 Mode = 0
  271.                 E["Speed",number] = 0
  272.                 E:propGravity(1)
  273.                
  274.                 P1:propGravity(1)
  275.                 P1:setMass(500)
  276.                 P1:applyForce(P1:up()*P1:mass())
  277.                 P1:unParent()
  278.                
  279.                 P2:propGravity(1)
  280.                 P2:setMass(500)
  281.                 P2:applyForce(P2:up()*P2:mass())
  282.                 P2:unParent()
  283.             }    
  284.     if(E["Health",number]<=25)
  285.     {
  286.                 E["Speed",number] = 50
  287.                 holoEntity(18):remove()
  288.                 P1:propGravity(1)
  289.                 P1:setMass(500)
  290.                 P1:unParent()
  291.                
  292.                 particleBounce(0)
  293.                 particleGravity(vec(0,0,-1))
  294.  
  295.                 particle(1,0,210,"particle/smokesprites_0001",vec(30),E:pos(),E:up()*110+randvec(-100,100),0,0,255,0)
  296.                 particle(0.5,50,0,"particles/flamelet2",vec(255,255,0),E:pos(),E:up()*150+randvec(-30,30),10,0,100,0)
  297.     }
  298.    
  299.     if(changed(E["Health",number]<=5)&E["Health",number]<=5)
  300.     {
  301.         soundPlay("al",1,"npc/turret_floor/alert.wav")
  302.     }
  303.  
  304.     if(clk("parent"))
  305.     {
  306.         Seat:setParent(E)
  307.                    
  308.         E:propFreeze(0)
  309.         stoptimer("parent")
  310.     }
  311.     if(Mode == 0)
  312.     {
  313.         soundPurge()
  314.         E:effectSpawn("Explosion",E:pos(),vec(300))
  315.         P1:remove()
  316.         P2:remove()
  317.         timer("dest",500)
  318.     }
  319.     if(clk("dest"))
  320.     {
  321.         selfDestructAll()
  322.     }
  323.     if(Z){ propDeleteAll() selfDestruct()}
  324.  
  325.     setName("Scout-W by Arkiss")
  326.  
Advertisement
Add Comment
Please, Sign In to add comment