Night_Wolf17

Rider-E2[updated]

Mar 21st, 2022 (edited)
1,384
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 14.38 KB | None | 0 0
  1. @name RiderE2V2
  2. @inputs
  3. @outputs
  4. @persist [E O Seat Seat2]:entity Speed XVel Col ADSpeed Act AR:array Music:array I Mode Aut
  5. @trigger
  6. @model models/hunter/plates/plate075x2.mdl
  7.  
  8.     # # # # # # # # # # # # # # # # # # # # # # # # #
  9.     #       BY ARKiSS 27.10.2021[updated 02.11.21]  #
  10.     # # # # # # # # # # # # # # # # # # # # # # # # #
  11.    
  12.         Driver = Seat:driver()
  13.    
  14.         W = Driver:keyForward()
  15.         S = Driver:keyBack()
  16.         A = Driver:keyLeft()
  17.         D = Driver:keyRight()
  18.         R = Driver:keyReload() # TO RESET RADAR
  19.         Fafa = Driver:keyPressed("F") # FAFA
  20.     if(duped()){ selfDestructAll() }
  21.     if(first())
  22.     {
  23.         noDuplications()
  24.         function entity cHolo(I:number,P:vector,Ang:angle,S:vector,C:vector){ holoCreate(I) holoPos(I,P) holoAng(I,Ang) holoScale(I,S) holoColor(I,C) holoParent(I,entity()) return holoEntity(I) }
  25.         function entity cHolo(I:number,P:vector,Ang:angle,S:vector,C:vector,M:string){ holoCreate(I) holoPos(I,P) holoAng(I,Ang) holoScale(I,S) holoColor(I,C) holoParent(I,entity()) holoModel(I,M) return holoEntity(I) }
  26.         function entity cHolo(I:number,P:vector,Ang:angle,S:vector,C:vector,Ent:entity){ holoCreate(I) holoPos(I,P) holoAng(I,Ang) holoScale(I,S) holoColor(I,C) holoParent(I,Ent) return holoEntity(I)}
  27.         function entity cHolo(I:number,P:vector,Ang:angle,S:vector,C:vector,M:string,Ent:entity){ holoCreate(I) holoPos(I,P) holoAng(I,Ang) holoScale(I,S) holoColor(I,C) holoModel(I,M) holoParent(I,Ent) return holoEntity(I)}
  28.  
  29.         O = owner()
  30.         E = entity()
  31.         E:setAlpha(0)
  32.  
  33.         Seat = seatSpawn("models/nova/airboat_seat.mdl",1)
  34.         Seat:setPos(E:toWorld(vec(-6,0,3)))
  35.         Seat:setAng(E:toWorld(ang(0,0,0)))
  36.         Seat:setMass(0)
  37.         Seat:setAlpha(0)        
  38.        
  39.         Seat2 = seatSpawn("models/nova/airboat_seat.mdl",1)
  40.         Seat2:setPos(E:toWorld(vec(-6,-30,4)))
  41.         Seat2:setAng(E:toWorld(ang(0,0,0)))
  42.         Seat2:setMass(0)
  43.         Seat2:setAlpha(0)
  44.        
  45.         E:setMass(500)
  46.         Speed = 7
  47.         ADSpeed = 30
  48.         E["height",number] = 60
  49.  
  50.         holoCreate(1) holoAlpha(1,0)
  51.         holoCreate(2) holoAlpha(2,0)
  52.        
  53.         holoParent(1,E)
  54.         holoParent(2,E)
  55.        
  56.       # # # # # # # # # # # # # # # # # # # # # # # # # # WHEELS # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
  57.         cHolo(3,holoEntity(1):toWorld(vec(0,0,22)),holoEntity(1):toWorld(ang(0,0,0)),vec(0.7,1,1),vec(255),"models/nateswheel/nateswheel.mdl",holoEntity(1))
  58.         cHolo(4,holoEntity(2):toWorld(vec(0,0,22)),holoEntity(2):toWorld(ang(0,0,0)),vec(0.7,1,1),vec(255),"models/nateswheel/nateswheel.mdl",holoEntity(2))
  59.  
  60.         cHolo(5,holoEntity(3):toWorld(vec(0,0,0)),holoEntity(3):toWorld(ang(90,0,0)),vec(1.95,1.95,1),vec(255),"models/mechanics/wheels/wheel_smooth_24.mdl",holoEntity(3))
  61.         cHolo(6,holoEntity(4):toWorld(vec(0,0,0)),holoEntity(4):toWorld(ang(90,0,0)),vec(1.95,1.95,1),vec(255),"models/mechanics/wheels/wheel_smooth_24.mdl",holoEntity(4))
  62.  
  63.         cHolo(7,holoEntity(3):toWorld(vec(0,0,0)),holoEntity(3):toWorld(ang(90,0,0)),vec(1.3,1.3,1.6),vec(0,0,250),"models/mechanics/wheels/wheel_smooth_24.mdl",holoEntity(3))
  64.         cHolo(8,holoEntity(4):toWorld(vec(0,0,0)),holoEntity(4):toWorld(ang(90,0,0)),vec(1.3,1.3,1.6),vec(0,0,250),"models/mechanics/wheels/wheel_smooth_24.mdl",holoEntity(4))
  65.       # # # # # # # # # # # # # # # # # # # # # # # # # # END # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
  66.  
  67.       # # # # # # # # # # # # # # # # # # # # # # # # # # BODY # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
  68.  
  69.         cHolo(9,E:toWorld(vec(-6,55,20)),E:toWorld(ang(-90,-90,0)),vec(0.4,0.5,0.6),vec(200),"models/props_combine/tprotato2.mdl",E)
  70.         cHolo(10,E:toWorld(vec(-6,-55,15)),E:toWorld(ang(-4,90,0)),vec(1.2,0.8,0.35),vec(200),"models/vehicles/prisoner_pod.mdl",E)
  71.  
  72.         cHolo(11,E:toWorld(vec(-14,40,0)),E:toWorld(ang(0,0,90)),vec(1.0,1.5,1.8),vec(255),"models/props_combine/combine_light002a.mdl",E)
  73.         cHolo(12,E:toWorld(vec(2,40,0)),E:toWorld(ang(0,180,-90)),vec(1.0,1.5,1.8),vec(255),"models/props_combine/combine_light002a.mdl",E)
  74.         cHolo(13,E:toWorld(vec(0,32,10)),E:toWorld(ang(0,0,90)),vec(3.5,3.5,5.8),vec(255),"models/Items/battery.mdl",E)
  75.         cHolo(14,E:toWorld(vec(-11.9,32,10)),E:toWorld(ang(180,0,90)),vec(3.5,3.5,5.8),vec(255),"models/Items/battery.mdl",E)        
  76.         cHolo(15,E:toWorld(vec(-6,-40,14)),E:toWorld(ang(0,0,-90)),vec(3.5,3.5,5.8),vec(255),"models/Items/combine_rifle_ammo01.mdl",E)        
  77.         cHolo(16,E:toWorld(vec(-6,-55,14)),E:toWorld(ang(0,0,-90)),vec(3.5,3.5,5.8),vec(255),"models/Items/combine_rifle_ammo01.mdl",E)        
  78.         cHolo(17,E:toWorld(vec(-6,0,27)),E:toWorld(ang(0,0,-95)),-vec(2,2,10),vec(0,75,110),"hq_sphere",E)        
  79.         holoClipEnabled(17,1)
  80.         holoClip(17,1,vec(0,109.6,80),vec(0,-1,1),0)
  81.        
  82.         cHolo(18,E:toWorld(vec(-6,0,27)),E:toWorld(ang(0,0,-95)),vec(2.1,2.1,10),vec(0,200,255),"hq_sphere",E)  
  83.         holoMaterial(18,"debug/debugbrushwireframe")    holoMaterial(17,"debug/debugdrawflat")
  84.            
  85.         holoClipEnabled(18,1)
  86.         holoClip(18,1,vec(0,109.6,80),vec(0,-1,1),0)
  87.  
  88.         cHolo(19,E:toWorld(vec(-6-14,-46,0)),E:toWorld(ang(0,-90,-90)),vec(1.5,1.0,1.0),vec(0,0,70),"models/sprops/trans/exhaust/tip_4.mdl",E)
  89.         cHolo(20,E:toWorld(vec(-6+14,-46,0)),E:toWorld(ang(0,-90,90)),vec(1.5,1.0,1.0),vec(0,0,70),"models/sprops/trans/exhaust/tip_4.mdl",E)
  90.         cHolo(21,E:toWorld(vec(-6,-30,9)),E:toWorld(ang(-90,90,0)),vec(3.6,3.8,4.5),vec(0,0,70),"models/Items/combine_rifle_ammo01.mdl",E)
  91.         cHolo(22,E:toWorld(vec(-6,31,20)),E:toWorld(ang(104,90,0)),vec(3.6,3.5,4.8),vec(0,0,70),"models/Items/combine_rifle_ammo01.mdl",E)
  92.         cHolo(23,E:toWorld(vec(-6,31,20)),E:toWorld(ang(104,90,0)),vec(2,3.5,4.8),vec(0,0,70),"models/Items/combine_rifle_ammo01.mdl",E)
  93.         cHolo(24,E:toWorld(vec(-6,0,27)),E:toWorld(ang(0,0,-95)),-vec(1.9,1.9,10),vec(255),"hq_sphere",E)  
  94.         holoMaterial(24,"debug/debugbrushwireframe")
  95.            
  96.         holoClipEnabled(24,1)
  97.         holoClip(24,1,vec(0,109.6,80),vec(0,-1,1),0)
  98.         cHolo(25,E:toWorld(vec(-6,0,27)),E:toWorld(ang(0,0,-95)),vec(2,2,10),vec(0,75,110),"hq_sphere",E)        
  99.         holoClipEnabled(25,1)
  100.         holoClip(25,1,vec(0,109.6,80),vec(0,-1,1),0)
  101.  
  102.         holoAlpha(17,50)
  103.         holoAlpha(24,10)
  104.         holoAlpha(25,200)
  105.        
  106.         holoMaterial(3,"phoenix_storms/black_chrome")   holoMaterial(5,"debug/debugdrawflat") holoMaterial(7,"models/shiny")
  107.         holoMaterial(4,"phoenix_storms/black_chrome")   holoMaterial(6,"debug/debugdrawflat") holoMaterial(8,"models/shiny")
  108.         timer("par",300)
  109.        
  110.         holoCreate(26,E:toWorld(vec(-6,22.7,26.5))) #####
  111.         holoScale(26,vec(1,0.5,0.5))
  112.         holoColor(26,vec(0))
  113.         holoModel(26,"models/sprops/trans/misc/gauge_3.mdl")
  114.         holoAng(26,E:toWorld(ang(-28,-90,0)))
  115.         holoSkin(26,4)
  116.         holoParent(26,E)
  117.  
  118.         holoCreate(27,E:toWorld(vec(-6,21.5,26.5)))
  119.         holoScale(27,vec(0.02))
  120.         holoColor(27,vec(155,0,0))
  121.         holoModel(27,"hq_sphere")
  122.         holoAng(27,E:toWorld(ang(130,0,0)))
  123.         holoParent(27,E)
  124.  
  125.         holoCreate(28,holoEntity(27):toWorld(vec(0,0,-0.4)))
  126.         holoScale(28,vec(0.005,0.005,0.2))
  127.         holoColor(28,vec(155,0,0))
  128.         holoAng(28,holoEntity(27):toWorld(ang(0,0,0)))
  129.         holoParent(28,27)
  130.  
  131.         holoMaterial(27,"debug/debugdrawflat")
  132.         holoMaterial(28,"debug/debugdrawflat")      
  133.        
  134.         cHolo(29,E:toWorld(vec(-6,31,21)),E:toWorld(ang(0,0,0)),vec(1.4,2,1.2),vec(0,110,200),"hq_sphere",E)  
  135.         holoMaterial(29,"phoenix_storms/indenttiles2")
  136.        
  137.       #  cHolo(30,E:toWorld(vec()),E:toWorld(ang(0,0,0)),vec(10,20,12),vec(255),"hq_sphere",E)  
  138.        # holoMaterial(30,"models/weapons/v_smg1/texture5")
  139.         #holoMaterial(30,"Models/effects/vol_light001")
  140.        
  141.         holoEntity(19):setTrails(30,50,0.5,"trails/physbeam",vec(220),200)
  142.         holoEntity(20):setTrails(30,50,0.5,"trails/physbeam",vec(220),200)
  143.        
  144.         soundPlay("go",0,"vehicles/diesel_loop2.wav")
  145.        
  146.         holoCreate(31,E:toWorld(vec(-6,7.5,26.3))) holoModel(31,"models/bull/dynamicbuttonflat.mdl")
  147.         holoColor(31,vec(0,150,220))
  148.         holoScale(31,vec(1.5))
  149.         holoParent(31,E)
  150.  
  151.         holoCreate(32,E:toWorld(vec(-6,7.5,26.3))) holoModel(32,"models/bull/dynamicbuttonflat.mdl")
  152.         holoColor(32,vec(0,0,75))
  153.         holoScale(32,vec(1.5))
  154.         holoMaterial(32,"models/wireframe")
  155.         holoParent(32,E)
  156.  
  157.         cHolo(200,E:toWorld(vec(18,-48,35)),E:toWorld(ang(0,180,-270)),vec(3.2,4.2,2.8),vec(200),"models/vehicles/inner_pod_rotator.mdl",E)
  158.        
  159.         Music[1,string] = "https://drive.google.com/uc?export=download&id=11AGSfxAiUFb6oOUUiwe-Ri6DDQQi6Esk"
  160.         Music[2,string] = "https://drive.google.com/uc?export=download&id=16ZbHHwqnmtub3oNr8O0EF22msVMBSTag"
  161.         Music[3,string] = "https://drive.google.com/uc?export=download&id=1U0D_gn42BCFzcmRD1Zh6VphIlgt6JfVM"
  162.         Music[4,string] = "https://drive.google.com/uc?export=download&id=1E8QY356qkVSYSJSAm-5kfn07amsaae_H"
  163.         Music[5,string] = "https://drive.google.com/file/d/1pRB05kOqpnrAxwLx1V62ldZoKUE5nz7u/view?usp=sharing"
  164.        
  165.         I = 0
  166.         soundURLparent("1",E)
  167.        
  168.         function void numMus()
  169.         {
  170.             if(changed(!Seat:driver())){  Mode = 0 }
  171.             local KLeft = Seat:driver():keyPressed("left")
  172.             local KRight = Seat:driver():keyPressed("right")
  173.             local KUp = Seat:driver():keyPressed("up")
  174.             local KDown = Seat:driver():keyPressed("down")
  175.             local TKey = Seat:driver():keyPressed("T")
  176.            
  177.             if(changed(TKey)&TKey){ Aut = !Aut }
  178.             if(Aut & Seat:driver()){ Mode = 1 }else{ Mode = 0 }
  179.             if(Mode == 1){ W = 1 }else{ W = W }
  180.             if(changed(Mode==1)&Mode==1){  E:soundPlay("aut",0,"hl1/fvox/powermove_overload.wav") }
  181.             if(changed(Mode==0)&Mode==0){  E:soundPlay("autDisable",0,"hl1/fvox/deactivated.wav") soundStop("aut")}
  182.             if(changed(KLeft)&KLeft){ I-=1 E:soundPlay("ck2",0,"buttons/button17.wav") soundURLPurge() soundURLload("1",Music[I,string],100,0,E)}
  183.             if(changed(KRight)&KRight){ I+=1 E:soundPlay("ck2",0,"buttons/button17.wav") soundURLPurge() soundURLload("1",Music[I,string],100,0,E)}
  184.             if(changed(KUp)&KUp){ E:soundPlay("ck2",0,"buttons/button17.wav") soundURLplay("1") }
  185.             if(changed(KDown)&KDown){ E:soundPlay("ck2",0,"buttons/button17.wav") soundURLpause("1") }
  186.             if(I<=-1){ I = 0 }
  187.         }
  188.     }
  189.     interval(40)
  190.     numMus()
  191.    
  192.     Z = O:keyPressed("z")
  193.    
  194.     if(clk("par")){ Seat:setParent(E) Seat2:setParent(E) E:propFreeze(0) stoptimer("par") }
  195.    
  196.     rangerFilter(E:getConstraints():add(players()))  
  197.     FW = rangerOffset(E["height",number],E:toWorld(vec(-6,55,0)),-E:up())
  198.     rangerFilter(E:getConstraints():add(players()))  
  199.     BW = rangerOffset(E["height",number],E:toWorld(vec(-6,-55,0)),-E:up())
  200.  
  201.     rangerFilter(E:getConstraints():add(players()))
  202.     FW2 = rangerOffset(50,E:toWorld(vec(0,80,20)),-E:right())
  203.     rangerFilter(E:getConstraints():add(players()))
  204.     BW2 = rangerOffset(50,E:toWorld(vec(0,-80,20)),E:right())
  205.     rangerFilter(E:getConstraints():add(players()))  
  206.  
  207.     if(FW2:hit()){ W = 0 applyForce(E:right()*150*E:mass()) FW2:entity():applyForce(-E:right()*FW2:entity():mass()*120-FW2:entity():velL())}
  208.     if(BW2:hit()){ S = 0 applyForce(-E:right()*150*E:mass()) BW2:entity():applyForce(E:right()*BW2:entity():mass()*120-BW2:entity():velL())}
  209.    
  210.     if(FW:hit()|BW:hit())
  211.     {
  212.         applyForce( ( vec( 0,0,(FW:hit()|BW:hit())*E["height",number]*0.7 - ((FW:distance()+BW:distance())/2 ))+-E:right()*(W-S) * Speed*2.15 - E:toWorldAxis(E:velL() * vec(0.025,0.020125,0.045)) )*E:mass() * 90/(500/13) )
  213.         local StabFW = ((E:velL():x() * -E:forward() * (1.2 - 0)) + (E:velL():y() * E:right() * (-0.02 - (0+0)) ))*E:mass()
  214.         applyForce(StabFW)
  215.  
  216.         Yaw = (A-D)
  217.         Roll = (BW:distance()-FW:distance())/8
  218.  
  219.         local AngYaw = clamp(Yaw*ADSpeed*8,-55,55)*E:mass()*20
  220.         E:applyTorque(vec(0,AngYaw,0))        
  221.         applyAngForce(( (-E:angles()*7 ):setYaw(0) - E:angVel()*2+ang(0,Yaw*ADSpeed*8-E:angVel():yaw(),clamp(Roll,-90,90)*100 ))*E:mass())
  222.     }
  223.    
  224.     holoPos(1,FW:pos())
  225.     holoPos(2,BW:pos())
  226.    
  227.         XVel=XVel+-E:velL():y()
  228.    
  229.     holoAng(3,holoEntity(1):toWorld(ang(0,0,XVel/2)))
  230.     holoAng(4,holoEntity(2):toWorld(ang(0,0,XVel/2)))
  231.     Col = (Col+0.1)%360
  232.     holoColor(5,hsv2rgb(Col,Col,1))
  233.     holoColor(6,hsv2rgb(Col,Col,1))
  234.     holoColor(7,hsv2rgb(Col,Col,1))
  235.     holoColor(8,hsv2rgb(Col,Col,1))
  236.    
  237.     soundPitch("go",abs(E:velL():y())/1.2*0.1+40)
  238.    
  239.     if(E:velL():y()>=0)
  240.     {
  241.         local YA = -180+clamp(E:velL():y()/4.1,0,450)
  242.         holoAng(27,E:toWorld(ang(180+20,90,0-YA)))
  243.     }
  244.     if(E:velL():y()<0)
  245.     {
  246.         local YA = -180+clamp(-E:velL():y()/4.1,0,450)
  247.         holoAng(27,E:toWorld(ang(180+20,90,0-YA)))
  248.     }
  249.     if(Fafa)
  250.     {
  251.         E:soundPlay("ss",0,"simulated_vehicles/horn_1.wav")
  252.         timer("stp",300)
  253.     }
  254.     if(clk("stp"))
  255.     {
  256.         #soundStop("ss")
  257.         stoptimer("stp")
  258.     }
  259.            
  260.     if(changed(R)&R){ Act = !Act }
  261.  
  262.     if(Z){ propDeleteAll() selfDestruct()}
  263.  
  264.     findIncludeClass("player*")
  265.     findInSphere(E:pos(),300)
  266.     AR = findToArray()
  267.    
  268.     foreach(I,V:entity=AR)
  269.     {
  270.         if(V:owner() != owner()&V:isAlive())
  271.         {
  272.             Size = 70
  273.             VPosX = V:pos():x()-E:pos():x()
  274.             VPosY = V:pos():y()-E:pos():y()
  275.             Pos = holoEntity(31):toWorld(vec(VPosX*cos(360/25*I),VPosY*sin(360/25*I),50)/Size)
  276.        
  277.             if(changed(AR:count())|AR:count()){  holoDisableShading(33+I,1) holoCreate(33+I) holoPos(33+I,Pos) holoParent(33+I,holoEntity(31)) holoModel(33+I,"hq_sphere") holoScale(33+I,vec(0.05)) holoColor(33+I,teamColor(V:team()))}
  278.             if(V:pos():distance(E:pos())>290|AR:count()==0|!V:isAlive()){holoUnparent(33+I) holoDelete(33+I)}
  279.         }
  280.     }
  281.     if(changed(R)&R)
  282.     {
  283.         for(I=1,30)
  284.         {
  285.             holoUnparent(33+I) holoDelete(33+I)
  286.         }        
  287.     }
  288.     setName("Rider-E2 by Arkiss")
Add Comment
Please, Sign In to add comment