Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @name Sentry Gun
- @persist Turret:entity X X2 X3 X4
- @persist Length1 Length2 Color:array
- @persist P_38_44 Len_38_44
- @persist Target:entity Range LoseRange Lose
- @persist InitDelay MinDelay Delay Buildup InitDamage Damage DBuildup
- @inputs CCFilter CCEntity:entity
- @outputs E156:entity Fire Damage
- #Hello, I am Peter
- if(first()|dupefinished()){
- runOnTick(1)
- findIncludePlayerProps(owner())
- findByClass("gmod_wire_turret")
- findSortByDistance(entity():pos())
- if(find():isValid() & find():pos():distance(entity():pos()) <= 200){
- Turret = find()
- }
- ColorBlue = array(vec(0,100,200),vec(0,50,100),vec(0,40,80))
- ColorOrange = array(vec(200,100,0),vec(100,50,0),vec(80,40,0)) ## ayy what?????
- ColorRed = array(vec(200,0,0),vec(100,0,0),vec(80,0,0))
- #Settings
- Color = ColorBlue
- Range = 1000
- LoseRange = 1500
- InitDelay = 9
- MinDelay = 2
- Buildup = 0.005
- InitDamage = 20
- DBuildup = 0.005
- #
- Delay = InitDelay
- Damage = InitDamage
- #Who designed these to make it not work when duped??? -Cheese
- #Box and origin
- holoCreate(1,entity():pos(),vec(),entity():angles():setYaw(180 + owner():eyeAngles():yaw()))
- holoParent(1,entity())
- holoCreate(2,holoEntity(1):pos(),vec(2,5,1/24),holoEntity(1):angles(),Color[1,vector])
- holoParent(2,1)
- holoCreate(103,holoEntity(1):toWorld(vec(11.75,0,0)),vec(),holoEntity(1):toWorld(ang()))
- holoParent(103,2)
- holoCreate(3,holoEntity(1):toWorld(vec(11.75,0,12)),vec(1/24,5,2),holoEntity(1):toWorld(ang()),Color[1,vector])
- holoAlpha(103,0)
- holoParent(3,103)
- holoCreate(104,holoEntity(1):toWorld(vec(-11.75,0,0)),vec(),holoEntity(1):toWorld(ang(0,180,0)))
- holoAlpha(104,0)
- holoParent(104,2)
- holoCreate(4,holoEntity(1):toWorld(vec(-11.75,0,12)),vec(1/24,5,2),holoEntity(1):toWorld(ang()),Color[1,vector])
- holoParent(4,104)
- holoCreate(105,holoEntity(1):toWorld(vec(0,29.75,0)),vec(),holoEntity(1):toWorld(ang(0,90,0)))
- holoAlpha(105,0)
- holoParent(105,2)
- holoCreate(5,holoEntity(1):toWorld(vec(0,29.75,12)),vec(23/12,1/24,2),holoEntity(1):toWorld(ang()),Color[1,vector])
- holoParent(5,105)
- holoCreate(106,holoEntity(1):toWorld(vec(0,-29.75,0)),vec(),holoEntity(1):toWorld(ang(0,-90,0)))
- holoAlpha(106,0)
- holoParent(106,2)
- holoCreate(6,holoEntity(1):toWorld(vec(0,-29.75,12)),vec(23/12,1/24,2),holoEntity(1):toWorld(ang()),Color[1,vector])
- holoParent(6,106)
- holoCreate(7,holoEntity(3):toWorld(vec(1,-12,12)),vec(1.5/12,1.5/12,8/12),holoEntity(1):toWorld(ang(0,0,90)),vec(50))
- holoModel(7,"hq_cylinder")
- holoParent(7,3)
- holoCreate(8,holoEntity(3):toWorld(vec(1,12,12)),vec(1.5/12,1.5/12,8/12),holoEntity(1):toWorld(ang(0,0,90)),vec(50))
- holoModel(8,"hq_cylinder")
- holoParent(8,3)
- holoCreate(108,holoEntity(3):toWorld(vec(1,0,12)),vec(),holoEntity(1):toWorld(ang()))
- holoAlpha(108,0)
- holoParent(108,8)
- holoCreate(9,holoEntity(1):toWorld(vec(0,0,24)),vec(2,2,5),holoEntity(1):toWorld(ang(0,0,90)),Color[1,vector])
- holoModel(9,"hq_tube_thin")
- holoClip(9,vec(0,-0.5,0),vec(0,1,0),0)
- holoClipEnabled(9,1)
- holoParent(9,108)
- holoCreate(10,holoEntity(9):toWorld(vec(0,0,29.75)),vec(22.5/12,22.5/12,1/24),holoEntity(9):toWorld(ang()),Color[1,vector])
- holoModel(10,"hq_cylinder")
- holoClip(10,vec(0,-0.5,0),vec(0,1,0),0)
- holoClipEnabled(10,1)
- holoParent(10,9)
- holoCreate(11,holoEntity(9):toWorld(vec(0,0,-29.75)),vec(22.5/12,22.5/12,1/24),holoEntity(9):toWorld(ang()),Color[1,vector])
- holoModel(11,"hq_cylinder")
- holoClip(11,vec(0,-0.5,0),vec(0,1,0),0)
- holoClipEnabled(11,1)
- holoParent(11,9)
- holoCreate(12,holoEntity(4):toWorld(vec(-1,0,9)),vec(1.5/12,1.5/12,6/12),holoEntity(1):toWorld(ang(0,0,90)),vec(50))
- holoModel(12,"hq_rcube")
- holoParent(12,9)
- holoCreate(13,holoEntity(9):toWorld(vec(0,9.1,0)),vec(3/12,2,1/24),holoEntity(1):toWorld(ang()),vec(50))
- holoParent(13,9)
- holoCreate(14,holoEntity(9):toWorld(vec(0,12,0)),vec(1/12,1/12,15/12),holoEntity(1):toWorld(ang(90,90,0)),vec(50))
- holoModel(14,"hqrcylinder")
- holoParent(14,9)
- holoCreate(15,holoEntity(9):toWorld(vec(0,10.5,7.9)),vec(1/12,1/12,4/12),holoEntity(1):toWorld(ang(22.5,90,0)),vec(50))
- holoModel(15,"hqrcylinder")
- holoParent(15,9)
- holoCreate(16,holoEntity(9):toWorld(vec(0,10.5,-7.9)),vec(1/12,1/12,4/12),holoEntity(1):toWorld(ang(-22.5,90,0)),vec(50))
- holoModel(16,"hqrcylinder")
- holoParent(16,9)
- #Hull
- holoCreate(17,holoEntity(1):toWorld(vec(0,16,11.5)),vec(20/12,20/12,1),holoEntity(1):toWorld(ang(175,90,0)),Color[2,vector])
- holoModel(17,"hqrcylinder")
- holoParent(17,1)
- holoCreate(18,holoEntity(17):toWorld(vec(12,0,0)),vec(13/12,14/12,11/12),holoEntity(17):toWorld(ang()),Color[2,vector])
- holoModel(18,"hq_rcube")
- holoClip(18,vec(0,0,0),vec(-1,0,0),0)
- holoClipEnabled(18,1)
- holoParent(18,17)
- holoCreate(19,holoEntity(17):toWorld(vec(12,0,0)),-holoScale(18):setX(2/12),holoEntity(18):toWorld(ang()),vec())
- holoModel(19,"hq_rcube")
- holoClip(19,vec(0,0,0),vec(-1,0,0),0)
- holoClipEnabled(19,1)
- holoParent(19,17)
- holoCreate(20,holoEntity(17):toWorld(vec(0,0,1.5)),vec(15/12,15/12,10/12),holoEntity(17):toWorld(ang()),vec(65))
- holoModel(20,"hqrcylinder")
- holoParent(20,17)
- #Skele
- holoCreate(21,holoEntity(17):toWorld(vec(12.3,0,0)),vec(1/24,15.25/12,6/12),holoEntity(17):toWorld(ang()),vec(65))
- holoCreate(22,holoEntity(17):toWorld(vec(9.55,7.375,0)),vec(5/12,1/24,6/12),holoEntity(17):toWorld(ang()),vec(65))
- holoParent(22,21)
- holoCreate(23,holoEntity(17):toWorld(vec(9.55,-7.375,0)),vec(5/12,1/24,6/12),holoEntity(17):toWorld(ang()),vec(65))
- holoParent(23,21)
- #V-pillar
- holoCreate(24,holoEntity(21):toWorld(vec(18.25,0,0)),vec(4.5/12,4.5/12,30/12),holoEntity(17):toWorld(ang(-90,0,0)),vec(65))
- holoModel(24,"hq_cylinder")
- holoParent(24,1)
- holoCreate(25,holoEntity(21):toWorld(vec(11.25,0,0)),vec(9/12,9/12,1/24),holoEntity(17):toWorld(ang(-90,0,0)),vec(65))
- holoModel(25,"hq_cylinder")
- holoParent(25,24)
- #H-pillar
- holoCreate(26,holoEntity(24):toWorld(vec(0,0,3)),vec(2/12,2/12,13.5/12),holoEntity(17):toWorld(ang(0,0,-90)),vec(35))
- holoModel(26,"hqrcylinder")
- holoParent(26,24)
- #L-frame
- holoCreate(27,holoEntity(24):toWorld(vec(3,5.375,6)),vec(1,1/24,1),holoEntity(17):toWorld(ang(5,0,0)),vec(65))
- holoParent(27,26)
- holoCreate(28,holoEntity(27):toWorld(vec(12,0,4.5)),vec(16/12,1/24,3/12),holoEntity(27):toWorld(ang(0,0,0)),vec(65))
- holoParent(28,27)
- holoCreate(29,holoEntity(26):toWorld(vec(0,0,5.375)),vec(13/12,13/12,0.7/12),holoEntity(17):toWorld(ang(0,0,90)),vec(15))
- holoModel(29,"hq_tube_thin")
- holoClip(29,1,vec(0,-1,0),vec(0,1,0),0)
- holoClipEnabled(29,1,1)
- holoClip(29,2,vec(1,0,0),vec(-20,3,0),0)
- holoClipEnabled(29,2,1)
- holoParent(29,27)
- #R-frame
- holoCreate(30,holoEntity(24):toWorld(vec(3,-5.375,6)),vec(1,1/24,1),holoEntity(17):toWorld(ang(5,0,0)),vec(65))
- holoParent(30,26)
- holoCreate(31,holoEntity(30):toWorld(vec(12,0,4.5)),vec(16/12,1/24,3/12),holoEntity(30):toWorld(ang(0,0,0)),vec(65))
- holoParent(31,30)
- holoCreate(32,holoEntity(26):toWorld(vec(0,0,-5.375)),vec(13/12,13/12,0.7/12),holoEntity(17):toWorld(ang(0,0,90)),vec(15))
- holoModel(32,"hq_tube_thin")
- holoClip(32,1,vec(0,-1,0),vec(0,1,0),0)
- holoClipEnabled(32,1,1)
- holoClip(32,2,vec(1,0,0),vec(-20,3,0),0)
- holoClipEnabled(32,2,1)
- holoParent(32,30)
- #L-leg
- holoCreate(133,holoEntity(26):toWorld(vec()),vec(),holoEntity(24):toWorld(ang()))
- holoAlpha(133,0)
- holoParent(133,24)
- holoCreate(33,holoEntity(26):toWorld(vec(-4,0,5.85)),vec(8/12,1.5/12,1/24),holoEntity(17):toWorld(ang(0,0,90)),vec(45))
- holoParent(33,133)
- holoClip(33,vec(-3 -0.125,0,0),vec(1,-1,0),0)
- holoClipEnabled(33,1)
- holoCreate(34,holoEntity(33):toWorld(vec(-3 -0.125,0,0)),vec(0.5/12,0.5/12,2/12),holoEntity(33):toWorld(ang(0,-45,90)),vec(45))
- holoModel(34,"hq_cylinder")
- holoParent(34,33)
- holoCreate(35,holoEntity(34):toWorld(vec(11 +0.125,0,0)),vec(22/12,1/24,2/12),holoEntity(34):toWorld(ang()),vec(45))
- holoParent(35,34)
- holoCreate(36,holoEntity(35):toWorld(vec(11.5,0,0)),vec(1/24,1/24,1/12),holoEntity(34):toWorld(ang(-90,0,0)),vec(45))
- holoModel(36,"hq_cylinder")
- holoParent(36,35)
- holoCreate(37,holoEntity(36):toWorld(vec(0,0,-0.8)),vec(1/12),holoEntity(34):toWorld(ang(0,0,0)),vec(45))
- holoModel(37,"hqsphere")
- holoParent(37,36)
- holoCreate(38,holoEntity(37):toWorld(vec(0.5,0,0)),vec(2/12,2/12,1/24),holoEntity(34):toWorld(ang(-90,0,0)),vec(45))
- holoModel(38,"hq_cylinder")
- holoParent(38,37)
- holoAng(34,holoEntity(34):toWorld(ang(0,-10,0)))
- #R-leg
- holoCreate(39,holoEntity(26):toWorld(vec(-4,0,-5.85)),vec(8/12,1.5/12,1/24),holoEntity(17):toWorld(ang(0,0,-90)),vec(45))
- holoClip(39,vec(-3 -0.125,0,0),vec(1,1,0),0)
- holoClipEnabled(39,1)
- holoParent(39,133)
- holoCreate(40,holoEntity(39):toWorld(vec(-3 -0.125,0,0)),vec(0.5/12,0.5/12,2/12),holoEntity(39):toWorld(ang(0,45,90)),vec(45))
- holoModel(40,"hq_cylinder")
- holoParent(40,39)
- holoCreate(41,holoEntity(40):toWorld(vec(11 +0.125,0,0)),vec(22/12,1/24,2/12),holoEntity(40):toWorld(ang()),vec(45))
- holoParent(41,40)
- holoCreate(42,holoEntity(41):toWorld(vec(11.5,0,0)),vec(1/24,1/24,1/12),holoEntity(40):toWorld(ang(-90,0,0)),vec(45))
- holoModel(42,"hq_cylinder")
- holoParent(42,41)
- holoCreate(43,holoEntity(42):toWorld(vec(0,0,-0.8)),vec(1/12),holoEntity(40):toWorld(ang(0,0,0)),vec(45))
- holoModel(43,"hqsphere")
- holoParent(43,42)
- holoCreate(44,holoEntity(43):toWorld(vec(0.5,0,0)),vec(2/12,2/12,1/24),holoEntity(40):toWorld(ang(-90,0,0)),vec(45))
- holoModel(44,"hq_cylinder")
- holoParent(44,43)
- holoAng(40,holoEntity(40):toWorld(ang(0,-10,0)))
- #Handle
- holoCreate(45,holoEntity(26):toWorld(vec(sin(-145)*(-3),cos(-145)*(-3),6.35)),vec(6/12,1.5/12,1/24),holoEntity(26):toWorld(ang(0,55,0)),vec(45))
- holoParent(45,26)
- holoCreate(46,holoEntity(26):toWorld(vec(sin(-145)*(-3),cos(-145)*(-3),-6.35)),vec(6/12,1.5/12,1/24),holoEntity(26):toWorld(ang(0,55,0)),vec(45))
- holoParent(46,26)
- holoCreate(47,holoEntity(45):toWorld(vec(2.4,0,-6.35)),vec(1/12,1/12,12.2/12),holoEntity(26):toWorld(ang()),vec(65))
- holoModel(47,"hq_cylinder")
- holoParent(47,26)
- #Hull control
- holoCreate(48,holoEntity(24):toWorld(vec(-2.25,0,12)),vec(2/12),holoEntity(1):toWorld(ang(-45,90,0)),vec(65))
- holoModel(48,"hq_sphere")
- Length1 = 5
- Length2 = 8
- holoCreate(49,holoEntity(48):toWorld(vec((Length1/2)+0.5,0,0)),vec(1/12,1/12,Length1/12),holoEntity(48):toWorld(ang(90,0,0)),vec(65))
- holoModel(49,"hq_cylinder")
- holoCreate(50,holoEntity(49):toWorld(vec(0,0,(Length1/2)+0.5)),vec(2/12),holoEntity(49):toWorld(ang(-90,0,0)),vec(65))
- holoModel(50,"hq_sphere")
- holoCreate(51,holoEntity(50):toWorld(vec((Length2/2)+0.5,0,0)),vec(1/12,1/12,Length2/12),holoEntity(50):toWorld(ang(90,0,0)),vec(65))
- holoModel(51,"hq_cylinder")
- holoCreate(52,holoEntity(51):toWorld(vec(0,0,(Length2/2)+0.5)),vec(2/12),holoEntity(51):toWorld(ang(-90,0,0)),vec(65))
- holoModel(52,"hq_sphere")
- holoCreate(53,holoEntity(52):toWorld(vec((Length2/2)+0.5,0,0)),vec(1/12,1/12,Length2/12),holoEntity(52):toWorld(ang(90,0,0)),vec(65))
- holoModel(53,"hq_cylinder")
- holoCreate(54,holoEntity(53):toWorld(vec(0,0,(Length2/2)+0.5)),vec(2/12),holoEntity(53):toWorld(ang(-90,0,0)),vec(65))
- holoModel(54,"hq_sphere")
- for(H = 49,54){
- holoParent(H,H-1)
- }
- holoParent(48,24)
- #[
- #unused diamond 2-limb ik method
- holoAng(48,holoEntity(24):(holoEntity(17):toWorld(vec(0,0,-6)) - holoEntity(48):pos()):toAngle())
- holoAng(48,holoEntity(48):toWorld(ang(-45,0,0)))
- IK1 = holoEntity(24):toLocal(holoEntity(50):pos())
- IK2 = holoEntity(24):toLocal(holoEntity(17):toWorld(vec(0,0,-6)))
- IK = vec2(IK2:x(),IK2:z())-vec2(IK1:x(),IK1:z())
- IK_r = sqrt(IK:x()^2 + IK:y()^2)
- IK_a = Length2 + 1
- holoAng(50,(holoEntity(17):toWorld(vec(0,0,-6)) - holoEntity(50):pos()):toAngle())
- holoAng(50,holoEntity(50):toWorld(ang(-acos(IK_r/2/IK_a),0,0)))
- ]#
- IK_ang = (holoEntity(24):toLocal(holoEntity(17):toWorld(vec(0,0,-6))) - holoEntity(24):toLocal(holoEntity(48):pos())):toAngle()+ang(30,0,0)
- holoAng(48,holoEntity(24):toWorld(IK_ang))
- IK1 = holoEntity(24):toLocal(holoEntity(50):pos())
- IK2 = holoEntity(24):toLocal(holoEntity(17):toWorld(vec(0,0,-6)))
- IK = vec2(IK2:x(),IK2:z())-vec2(IK1:x(),IK1:z())
- IK_r = sqrt(IK:x()^2 + IK:y()^2)
- IK_a = Length2 + 1
- IK_theta1 = IK_ang:pitch() - 270 - (acos(IK:y()/IK_r) + acos(((IK_r*IK_r)/(2*IK_a*IK_r))))
- IK_theta2 = 180 - acos(((IK_a^2)*2-(IK_r^2))/(2*(IK_a^2)))
- holoAng(50,holoEntity(48):toWorld(ang(-IK_theta1,0,0)))
- holoAng(52,holoEntity(50):toWorld(ang(-IK_theta2,0,0)))
- #[
- #Failed 3-limb ik
- IK1 = vec(-2.25,0,12)
- IK2 = holoEntity(24):toLocal(holoEntity(17):toWorld(vec(0,0,-6)))
- IK_a1 = Length1 + 1
- IK_a2 = Length2 + 1
- IK = vec2(IK2:x(),IK2:z())-vec2(IK1:x(),IK1:z())
- IK_r1 = (vec2():distance(IK))/2
- IK_phi1 = 180/(1+(2*IK_a2/IK_a1))
- IK_phi2 = 180/(2+(IK_a1/IK_a2))
- IK_phi3 = asin(7.9*sin(IK_phi1)/IK_a1)
- IK_phi7 = abs(atan(IK:x()/IK:y()))
- IK_theta1 = 180 - IK_phi1 - IK_phi3 + IK_phi7
- IK_r2 = sqrt((IK_r1^2) + (IK_a1^2) - (2*IK_r1*IK_a1*cos(180 - IK_phi1 - IK_phi3)))
- IK_phi5 = asin((IK_r2*sin(IK_phi2))/IK_a2)
- IK_phi4 = 180 - IK_phi2 - IK_phi5
- IK_theta2 = 180 - IK_phi3 - IK_phi4
- IK_phi6 = asin((IK_r1*sin(IK_phi2))/IK_a2)
- IK_theta3 = 180 - IK_phi5 - IK_phi6
- IK_print1 = IK_phi1:toString()+", "+IK_phi2:toString()+", "+IK_phi3:toString()+", "+IK_phi7:toString()
- IK_print2 = IK_phi4:toString()+", "+IK_phi5:toString()+", "+IK_phi6:toString()
- IK_print3 = IK_theta1:toString()+", -"+IK_theta2:toString()+", -"+IK_theta3:toString()
- #print(IK)
- #print(asin(IK_r1*sin(IK_phi1)/IK_a1))
- #print(IK_r1)
- #print(holoEntity(48):pos():distance(holoEntity(50):pos()))
- print("Phi 1,2,3,7: "+IK_print1)
- print("Phi 4,5,6: "+IK_print2)
- print("Theta 1,2: "+IK_print3)
- holoAng(48,holoEntity(24):toWorld(ang(-90-IK_theta1,0,0)))
- holoAng(50,holoEntity(48):toWorld(ang(IK_theta2,0,0)))
- holoAng(52,holoEntity(50):toWorld(ang(IK_theta3,0,0)))
- ]#
- holoParent(17,24)
- #V-pillar top
- holoCreate(55,holoEntity(24):toWorld(vec(0,0,15)),vec(4.5/12),holoEntity(24):toWorld(ang()),vec(65))
- holoModel(55,"hq_sphere")
- holoParent(55,24)
- holoCreate(156,holoEntity(55):toWorld(vec(0,0,1)),vec(),holoEntity(24):toWorld(ang()))
- holoParent(156,55)
- holoCreate(56,holoEntity(156):toWorld(vec()),vec(1.5/12,1.5/12,8/12),holoEntity(17):toWorld(ang(0,0,90)),vec(65))
- holoModel(56,"hq_cylinder")
- holoParent(56,156)
- #
- holoCreate(57,holoEntity(56):toWorld(vec(0,0,3.5)),vec(2/12,2/12,1/12),holoEntity(56):toWorld(ang()),vec(45))
- holoModel(57,"hq_tube")
- holoParent(57,56)
- holoCreate(58,holoEntity(56):toWorld(vec(-1.125,0,3.5)),vec(2.25/12,2/12,0.75/12),holoEntity(56):toWorld(ang()),vec(45))
- holoParent(58,57)
- holoCreate(59,holoEntity(56):toWorld(vec(0,0,-3.5)),vec(2/12,2/12,1/12),holoEntity(56):toWorld(ang()),vec(45))
- holoModel(59,"hq_tube")
- holoParent(59,56)
- holoCreate(60,holoEntity(56):toWorld(vec(-1.125,0,-3.5)),vec(2.25/12,2/12,0.75/12),holoEntity(56):toWorld(ang()),vec(45))
- holoParent(60,59)
- holoParent(21,156)
- #Extension legs
- #28,31
- holoCreate(61,holoEntity(28):toWorld(vec(-4,-1.125,0)),vec(1.75/12,1.75/12,8/12),holoEntity(28):toWorld(ang(-90,0,0)),vec(65),"hq_tube_thin")
- holoParent(61,28)
- holoCreate(62,holoEntity(61):toWorld(vec(0,0,-4)),vec(1.5/12,1.5/12,16/12),holoEntity(61):toWorld(ang()),vec(45),"hq_cylinder")
- holoCreate(63,holoEntity(31):toWorld(vec(-4,1.125,0)),vec(1.75/12,1.75/12,8/12),holoEntity(31):toWorld(ang(-90,0,0)),vec(65),"hq_tube_thin")
- holoParent(63,31)
- holoCreate(64,holoEntity(63):toWorld(vec(0,0,-4)),vec(1.5/12,1.5/12,16/12),holoEntity(63):toWorld(ang()),vec(45),"hq_cylinder")
- holoCreate(65,holoEntity(64):toWorld(vec(0,4.25,-4)),vec(0.5/12,9.5/12,5/12),holoEntity(64):toWorld(ang()),vec(45))
- holoParent(62,65)
- holoParent(64,65)
- holoParent(65,26)
- holoCreate(66,holoEntity(62):toWorld(vec(0,0,-8.9)),vec(1/12,1.2/12,2/12),holoEntity(62):toWorld(ang(180,0,0)),vec(45),"pyramid")
- holoParent(66,65)
- holoCreate(67,holoEntity(64):toWorld(vec(0,0,-8.9)),vec(1/12,1.2/12,2/12),holoEntity(64):toWorld(ang(180,0,0)),vec(45),"pyramid")
- holoParent(67,65)
- #Hull_front
- #/2-4 extend,/2 inside
- holoCreate(68,holoEntity(18):toWorld(vec(-15/2,0,0)),vec(15/12,14/12,11/12)-vec(0,1/192,1/192),holoEntity(18):toWorld(ang()),vec(65),"hqrcube")
- holoClip(68,vec(holoScale(68):x()*6 - 0.3,0,0),vec(-1,0,0),0)
- holoClipEnabled(68,1)
- holoParent(68,18)
- #nice
- holoCreate(69,holoEntity(68):pos(),-holoScale(68),holoEntity(68):toWorld(ang()),vec(65),"hqrcube")
- holoClip(69,vec(holoScale(68):x()*6 - 0.3,0,0),vec(-1,0,0),0)
- holoClipEnabled(69,1)
- holoParent(69,68)
- holoCreate(70,holoEntity(68):toWorld(vec(holoScale(68):x()*6-2,0,0)),(holoScale(18):setX(1/12))-vec(0,1/12,1/12),holoEntity(18):toWorld(ang()),Color[3,vector])
- holoParent(70,68)
- entity():setMaterial("models/wireframe")
- for(H = 1,70){
- holoAlpha(H,0)
- }
- E156 = noentity()
- X = 0
- Up24 = 0
- Len_38_44 = 0
- P_38_44 = 0
- X4 = 0
- Target = noentity()
- X3 = 0
- X2 = 0
- }
- else{
- if(changed(first())){
- for(H = 1,70){
- holoAlpha(H,255)
- ColorBlue:clear()
- ColorOrange:clear()
- ColorRed:clear()
- }
- }
- if(X <= 600){
- X += 1
- if(X >= 50 & X < 61){
- for(H = 103,106){
- holoAng(H,holoEntity(H):toWorld(ang(8,0,0)))
- }
- }
- if(X >= 61 & X < 65){
- holoAng(108,holoEntity(108):toWorld(ang(5,0,0)))
- }
- elseif(X >= 70 & X < 160){
- holoPos(24,holoEntity(24):pos() + holoEntity(1):toWorld(vec(0,14.43374803/90,6.25/90)) - holoEntity(1):pos())
- holoAng(24,holoEntity(1):toWorld(ang(84*(1 - ((X-70) / 90)),90 + 90*((X-70) / 90),0)))
- }
- elseif(X >= 163 & X < 208){
- holoAng(34,holoEntity(34):toWorld(ang(0,-3,0)))
- holoAng(40,holoEntity(40):toWorld(ang(0,-3,0)))
- }
- elseif(X >= 213 & X < 246){
- holoAng(133,holoEntity(133):toWorld(ang(3,0,0)))
- }
- elseif(X >= 249 & X < 279){
- holoAng(37,holoEntity(37):angles():setPitch(holoEntity(1):angles():pitch()+90))
- holoAng(43,holoEntity(43):angles():setPitch(holoEntity(1):angles():pitch()+90))
- Up24 += (8/29)
- holoPos(24,holoEntity(26):pos() + holoEntity(24):up()*Up24)
- holoAng(24,holoEntity(1):toWorld(ang(0,180,0)))
- holoPos(26,holoEntity(133):pos())
- holoAng(26,holoEntity(26):toWorld(ang(0,1.6,0)))
- holoPos(133,holoEntity(3844):toWorld(vec(Len_38_44*cos(P_38_44 - (X - 249)),0,-Len_38_44*sin(P_38_44 - (X - 249)))))
- holoAng(133,(holoEntity(3844):pos() - holoEntity(133):pos()):toAngle()+ang(53,0,0))
- }
- elseif(X >= 279 & X < 287){
- holoPos(65,holoEntity(65):toWorld(vec(0,0,-1)))
- }
- elseif(X >= 283 & X < 313){
- holoAng(37,holoEntity(37):angles():setPitch(holoEntity(1):angles():pitch()+90))
- holoAng(43,holoEntity(43):angles():setPitch(holoEntity(1):angles():pitch()+90))
- Up24 -= (8/29)
- holoPos(24,holoEntity(26):pos() + holoEntity(24):up()*Up24)
- holoAng(24,holoEntity(1):toWorld(ang(0,180,0)))
- holoPos(26,holoEntity(133):pos())
- holoAng(26,holoEntity(26):toWorld(ang(0,0.26,0)))
- holoPos(133,holoEntity(3844):toWorld(vec(Len_38_44*cos(P_38_44 + (X - 283)),0,-Len_38_44*sin(P_38_44 + (X - 283)))))
- holoAng(133,(holoEntity(3844):pos() - holoEntity(133):pos()):toAngle()+ang(53,0,0))
- }
- elseif(X >= 320 & X < 440){
- holoPos(24,holoEntity(24):toWorld(vec(0,0,0.025)))
- holoAng(24,holoEntity(24):toWorld(ang(0,6,0)))
- }
- elseif(X >= 445 & X < 486){
- holoPos(17,holoEntity(17):pos() + holoEntity(24):toWorld(vec(-0.5,0,0))-holoEntity(24):pos())
- holoAng(17,holoEntity(17):toWorld(ang(-95/40,0,0)))
- IK_ang = (holoEntity(24):toLocal(holoEntity(17):toWorld(vec(0,0,-6))) - holoEntity(24):toLocal(holoEntity(48):pos())):toAngle()+ang(30,0,0)
- holoAng(48,holoEntity(24):toWorld(IK_ang))
- IK1 = holoEntity(24):toLocal(holoEntity(50):pos())
- IK2 = holoEntity(24):toLocal(holoEntity(17):toWorld(vec(0,0,-6)))
- IK = vec2(IK2:x(),IK2:z())-vec2(IK1:x(),IK1:z())
- IK_r = sqrt(IK:x()^2 + IK:y()^2)
- IK_a = Length2 + 1
- IK_theta1 = IK_ang:pitch() - 270 - (acos(IK:y()/IK_r) + acos(((IK_r*IK_r)/(2*IK_a*IK_r))))
- IK_theta2 = 180 - acos(((IK_a^2)*2-(IK_r^2))/(2*(IK_a^2)))
- holoAng(50,holoEntity(48):toWorld(ang(-IK_theta1,0,0)))
- holoAng(52,holoEntity(50):toWorld(ang(-IK_theta2,0,0)))
- }
- elseif(X >= 486 & X < 493){
- holoPos(68,holoEntity(68):toWorld(vec(1.83,0,0)))
- }
- elseif(X >= 495 & X < 511){
- holoPos(17,holoEntity(17):pos() + holoEntity(24):toWorld(vec(2/16,0,-6.5/16))-holoEntity(24):pos())
- holoAng(17,holoEntity(17):toWorld(ang(7.5/16,0,0)))
- IK_ang = (holoEntity(24):toLocal(holoEntity(17):toWorld(vec(0,0,-6))) - holoEntity(24):toLocal(holoEntity(48):pos())):toAngle()+ang(45,0,0)
- holoAng(48,holoEntity(24):toWorld(IK_ang))
- IK1 = holoEntity(24):toLocal(holoEntity(50):pos())
- IK2 = holoEntity(24):toLocal(holoEntity(17):toWorld(vec(0,0,-6)))
- IK = vec2(IK2:x(),IK2:z())-vec2(IK1:x(),IK1:z())
- IK_r = sqrt(IK:x()^2 + IK:y()^2)
- IK_a = Length2 + 1
- IK_theta1 = IK_ang:pitch() - 270 - (acos(IK:y()/IK_r) + acos(((IK_r*IK_r)/(2*IK_a*IK_r))))
- IK_theta2 = 180 - acos(((IK_a^2)*2-(IK_r^2))/(2*(IK_a^2)))
- holoAng(50,holoEntity(48):toWorld(ang(-IK_theta1,0,0)))
- holoAng(52,holoEntity(50):toWorld(ang(-IK_theta2,0,0)))
- }
- elseif(X >= 521 & X < 532){
- holoColor(87,holoEntity(87):getColor()+vec(10,0,0))
- }
- if(X == 247){
- holoAng(37,holoEntity(37):angles():setPitch(holoEntity(1):angles():pitch()+90))
- holoAng(43,holoEntity(43):angles():setPitch(holoEntity(1):angles():pitch()+90))
- V_38_44 = (holoEntity(38):boxCenterW() + holoEntity(44):boxCenterW())/2
- Len_38_44 = V_38_44:distance(holoEntity(133):boxCenterW())
- holoCreate(3844,V_38_44,vec(1/12),holoEntity(1):angles())
- holoAlpha(3844,0)
- holoParent(3844,1)
- A_38_44 = holoEntity(3844):toLocal((holoEntity(133):pos() - holoEntity(3844):pos()):toAngle())
- P_38_44 = A_38_44:pitch()
- Up24 = holoEntity(1):toLocal(holoEntity(24):pos()):z() - holoEntity(1):toLocal(holoEntity(26):pos()):z()
- holoUnparent(24)
- holoUnparent(26)
- holoUnparent(133)
- holoParent(24,26)
- holoParent(133,3844)
- }
- elseif(X == 279){
- holoUnparent(133)
- }
- elseif(X == 280){
- A_38_44 = holoEntity(3844):toLocal((holoEntity(133):pos() - holoEntity(3844):pos()):toAngle())
- P_38_44 = A_38_44:pitch()
- }
- elseif(X == 313){
- holoDelete(3844)
- holoUnparent(133)
- holoUnparent(26)
- holoUnparent(33)
- holoUnparent(39)
- holoParent(24,1)
- holoParent(26,1)
- holoParent(33,1)
- holoParent(39,1)
- holoParent(133,1)
- }
- elseif(X == 442){
- #Tube
- holoCreate(71,holoEntity(68):toWorld(vec(holoScale(68):x()*6-1.25,3,-1.5)),vec(5.5/12,5.5/12,0.5/12),holoEntity(18):toWorld(ang(90,0,0)),vec(45),"hq_cylinder")
- holoParent(71,70)
- holoCreate(72,holoEntity(71):toWorld(vec(0,0,0.5625)),vec(3/12,3/12,0.125/12),holoEntity(71):toWorld(ang()),vec(25),"hq_cylinder")
- holoParent(72,71)
- holoCreate(172,holoEntity(72):pos(),vec(),holoEntity(18):toWorld(ang()))
- holoAlpha(172,0)
- holoParent(172,72)
- holoCreate(73,holoEntity(71):toWorld(vec(0,0,1)),vec(4/12,4/12,1.5/12),holoEntity(71):toWorld(ang()),vec(45),"hq_tube")
- holoParent(73,71)
- holoCreate(74,holoEntity(71):toWorld(vec(0,0,2.25)),vec(4/12,4/12,1/12),holoEntity(71):toWorld(ang()),vec(45),"hq_tube")
- holoClip(74,vec(1,0,0),vec(1,0,0),0)
- holoClipEnabled(74,1)
- holoParent(74,73)
- holoCreate(75,holoEntity(71):toWorld(vec(0,0,2.25)),vec(4/12,4/12,1/12),holoEntity(71):toWorld(ang()),vec(45),"hq_tube")
- holoClip(75,vec(-1,0,0),vec(-1,0,0),0)
- holoClipEnabled(75,1)
- holoParent(75,73)
- #Clip covers......
- holoCreate(76,holoEntity(71):toWorld(vec(1.055,1.4066,2.25)),vec(1/12,0.62/12,1/768),holoEntity(71):toWorld(ang(-90,0,0)),vec(45))
- holoParent(76,74)
- holoCreate(77,holoEntity(71):toWorld(vec(1.055,-1.4066,2.25)),vec(1/12,0.62/12,1/768),holoEntity(71):toWorld(ang(-90,0,0)),vec(45))
- holoParent(77,74)
- holoCreate(78,holoEntity(71):toWorld(vec(-1.055,1.4066,2.25)),vec(1/12,0.62/12,1/768),holoEntity(71):toWorld(ang(-90,0,0)),vec(45))
- holoParent(78,74)
- holoCreate(79,holoEntity(71):toWorld(vec(-1.055,-1.4066,2.25)),vec(1/12,0.62/12,1/768),holoEntity(71):toWorld(ang(-90,0,0)),vec(45))
- holoParent(79,74)
- holoCreate(80,holoEntity(71):toWorld(vec(0,0,3.5)),vec(4/12,4/12,1.5/12),holoEntity(71):toWorld(ang()),vec(45),"hq_tube")
- holoParent(80,73)
- #Camera and light
- holoCreate(81,holoEntity(68):toWorld(vec(holoScale(68):x()*6-1.375,-1.6,-2.5)),vec(1.8/12,1.8/12,0.25/12),holoEntity(18):toWorld(ang(90,0,0)),vec(45),"hq_cylinder")
- holoParent(81,70)
- holoCreate(82,holoEntity(68):toWorld(vec(holoScale(68):x()*6-1.375,-3,-2.5)),vec(1.8/12,1.8/12,0.25/12),holoEntity(18):toWorld(ang(90,0,0)),vec(45),"hq_cylinder")
- holoParent(82,70)
- holoCreate(83,holoEntity(68):toWorld(vec(holoScale(68):x()*6-1.375,-2.3,-2.5)),vec(1.8/12,1.4/12,0.25/12),holoEntity(18):toWorld(ang(90,0,0)),vec(45))
- holoParent(83,70)
- holoCreate(84,holoEntity(68):toWorld(vec(holoScale(68):x()*6-1.375,-3.7,-1.8)),vec(1.2/12,1.2/12,0.25/12),holoEntity(18):toWorld(ang(90,0,0)),vec(45),"hq_cylinder")
- holoParent(84,70)
- holoCreate(85,holoEntity(81):toWorld(vec(0,0,0.125)),vec(1/12,1/12,0.5/12),holoEntity(81):angles(),vec(10),"hq_dome")
- holoParent(85,81)
- holoCreate(86,holoEntity(82):toWorld(vec(0,0,0.125)),vec(1/12,1/12,0.5/12),holoEntity(82):angles(),vec(10),"hq_dome")
- holoParent(86,82)
- holoCreate(87,holoEntity(84):toWorld(vec(0,0,0.125)),vec(0.5/12,0.5/12,0.4/12),holoEntity(84):angles(),vec(50,10,10),"hq_dome")
- holoParent(87,84)
- holoCreate(88,holoEntity(83):toWorld(vec(0,0,0.125+0.0025)),vec(1/12,1.4/12,0.005/12),holoEntity(84):angles(),vec(35))
- holoParent(88,85)
- holoUnparent(17)
- holoParent(17,156)
- for(H = 71,90){
- holoAlpha(H,0)
- }
- }
- elseif(X == 485){
- for(H = 71,90){
- holoAlpha(H,255)
- }
- }
- elseif(X == 512){
- for(H = 2,12){
- holoDelete(H)
- }
- findClearWhitePlayerPropList()
- findIncludeClass("player")
- findIncludeClass("npc_*")
- }
- }
- else{
- IK_offset0 = holoEntity(24):toLocal(holoEntity(17):toWorld(vec(0,0,-6))) - holoEntity(24):toLocal(holoEntity(48):pos())
- if(IK_offset0:x() >= 0){
- IK_ang0 = IK_offset0:toAngle():setYaw(180):setPitch(270-IK_offset0:toAngle():pitch()+270)
- }
- else{
- IK_ang0 = IK_offset0:toAngle()
- }
- if(IK_ang0:pitch() >= 270){
- if(IK_ang0:pitch() <= 315){
- IK_ang = IK_ang0 + ang(45-(310-IK_ang0:pitch()),0,0)
- }
- else{
- IK_ang = IK_ang0 + ang(45,0,0)
- }
- }
- elseif(IK_ang0:pitch() <= 90){
- IK_ang = IK_ang0 + ang(45-IK_ang0:pitch(),0,0)
- }
- else{
- IK_ang = ang(270,180,0)
- }
- holoAng(48,holoEntity(24):toWorld(IK_ang))
- IK1 = holoEntity(24):toLocal(holoEntity(50):pos())
- IK2 = holoEntity(24):toLocal(holoEntity(17):toWorld(vec(0,0,-6)))
- IK = vec2(abs(IK2:x()-IK1:x()),abs(IK2:z()-IK1:z()))
- IK_r = sqrt(IK:x()^2 + IK:y()^2)
- IK_a = Length2 + 1
- if(IK_ang:pitch() == 270){
- IK_theta1 = 90 - (acos(IK:x()/IK_r) + acos(((IK_r*IK_r)/(2*IK_a*IK_r))))
- }
- else{
- IK_theta1 = IK_ang:pitch() - 270 - (acos(IK:y()/IK_r) + acos(((IK_r*IK_r)/(2*IK_a*IK_r))))
- }
- IK_theta2 = 180 - acos(((IK_a^2)*2-(IK_r^2))/(2*(IK_a^2)))
- holoAng(50,holoEntity(48):toWorld(ang(-IK_theta1,0,0)))
- holoAng(52,holoEntity(50):toWorld(ang(-IK_theta2,0,0)))
- X4 += 1
- if(CCFilter == 1){
- if(changed(CCEntity)){
- if(CCEntity:isValid()){
- Delay = InitDelay
- Damage = InitDamage
- Lose = 0
- }
- }
- if(CCEntity:isValid()){
- Aiming = CCEntity:boxCenterW()+Target:vel()*0.2
- X3 += 1
- if(Delay - Buildup < MinDelay){
- Delay = MinDelay
- }
- elseif(Delay - Buildup > MinDelay){
- Delay -= Buildup
- }
- if(X3%round(Delay) == 0){
- Fire = 1
- }
- else{
- Fire = 0
- }
- Damage += DBuildup
- }
- else{
- Aiming = holoEntity(1):toWorld(vec(cos(sin(X4*2.5)*75)*(-200),sin(sin(X4*2.5)*75)*(-200),holoEntity(1):toLocal(holoEntity(156):pos()):z()+6))
- Fire = 0
- }
- }
- else{
- if(changed(Target)){
- if(Target:isValid()){
- Delay = InitDelay
- Damage = InitDamage
- Lose = 0
- }
- }
- if(Target:isValid()){
- if(!Target:isAlive()){
- Target = noentity()
- Aiming = holoEntity(1):toWorld(vec(cos(sin(X4*2.5)*75)*(-200),sin(sin(X4*2.5)*75)*(-200),holoEntity(1):toLocal(holoEntity(156):pos()):z()+6))
- }
- else{
- Aiming = Target:boxCenterW()+Target:vel()*0.2
- X3 += 1
- if(Delay - Buildup < MinDelay){
- Delay = MinDelay
- }
- elseif(Delay - Buildup > MinDelay){
- Delay -= Buildup
- }
- if(X3%round(Delay) == 0){
- Fire = 1
- }
- else{
- Fire = 0
- }
- Damage += DBuildup
- rangerFilter(entity())
- rangerFilter(Turret)
- if(rangerOffset(holoEntity(172):pos(),Target:boxCenterW()):entity() != Target & rangerOffset(holoEntity(172):pos(),Target:shootPos()):entity() != Target){
- Lose += 1
- }
- if(Target:boxCenterW():distance(holoEntity(156):pos()) >= LoseRange){
- Lose += 1
- }
- if(Lose >= 15){
- Target = noentity()
- }
- }
- }
- else{
- Aiming = holoEntity(1):toWorld(vec(cos(sin(X4*2.5)*75)*(-200),sin(sin(X4*2.5)*75)*(-200),holoEntity(1):toLocal(holoEntity(156):pos()):z()+6))
- Fire = 0
- findInSphere(holoEntity(156):pos(),Range)
- findSortByDistance(holoEntity(156):pos())
- rangerFilter(entity())
- rangerFilter(Turret)
- foreach(EntI,Ent:entity = findToArray()){
- if(Ent != owner() & Ent:isValid() & (rangerOffset(holoEntity(172):pos(),Ent:boxCenterW()):entity() == Ent|rangerOffset(holoEntity(172):pos(),Ent:shootPos()):entity() == Ent)){
- Target = Ent
- break
- }
- else{
- continue
- }
- }
- }
- }
- A = (holoEntity(24):toLocal(Aiming)-holoEntity(24):toLocal(holoEntity(172):pos())):toAngle()
- holoAng(24,holoEntity(24):toWorld(A:setPitch(0):setRoll(0)))
- A2 = (holoEntity(24):toLocal(Aiming)-holoEntity(24):toLocal(holoEntity(172):pos())):toAngle()
- if(A2:pitch() <= -30){
- holoAng(156,holoEntity(24):toWorld(ang(-30,0,0)))
- }
- else{
- holoAng(156,holoEntity(24):toWorld(A2:setYaw(0):setRoll(0)))
- }
- if(Turret:isValid()){
- if(!Turret:isFrozen()){
- TurretPos = holoEntity(172):toWorld(vec(0,0,0))
- Turret:applyForce(((TurretPos - Turret:boxCenterW())*5 - Turret:vel()*0.4)*Turret:mass())
- TurretAng = holoEntity(172):angles()
- TurretL = Turret:toLocal(rotationVector(quat(TurretAng)/quat(Turret)) + Turret:pos())
- Turret:applyTorque((TurretL*300-Turret:angVelVector()*40)*Turret:inertia())
- X2 += 1
- if(X2%20 == 1){
- Turret:setMass(2000)
- Turret:setMaterial("")
- Turret:setColor(vec(255))
- Turret:setAlpha(0)
- }
- }
- else{
- X2 += 1
- if(X2%20 == 1){
- Turret:setMass(2000)
- Turret:setMaterial("models/wireframe")
- Turret:setColor(vec(255,0,0))
- Turret:setAlpha(255)
- }
- }
- }
- }
- if(holoEntity(156):isValid()){
- E156 = holoEntity(156)
- }
- else{
- E156 = noentity()
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment