Cheesecaked

Sentry Gun Updates

Oct 30th, 2022 (edited)
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 36.01 KB | None | 0 0
  1. @name Sentry Gun
  2. @persist Turret:entity X X2 X3 X4
  3. @persist Length1 Length2 Color:array
  4. @persist P_38_44 Len_38_44
  5. @persist Target:entity Range LoseRange Lose
  6. @persist InitDelay MinDelay Delay Buildup InitDamage Damage DBuildup
  7. @inputs CCFilter CCEntity:entity
  8. @outputs E156:entity Fire Damage
  9.  
  10. #Hello, I am Peter
  11.  
  12. if(first()|dupefinished()){
  13. runOnTick(1)
  14.  
  15. findIncludePlayerProps(owner())
  16. findByClass("gmod_wire_turret")
  17. findSortByDistance(entity():pos())
  18. if(find():isValid() & find():pos():distance(entity():pos()) <= 200){
  19. Turret = find()
  20. }
  21.  
  22. ColorBlue = array(vec(0,100,200),vec(0,50,100),vec(0,40,80))
  23. ColorOrange = array(vec(200,100,0),vec(100,50,0),vec(80,40,0)) ## ayy what?????
  24. ColorRed = array(vec(200,0,0),vec(100,0,0),vec(80,0,0))
  25.  
  26. #Settings
  27. Color = ColorBlue
  28.  
  29. Range = 1000
  30. LoseRange = 1500
  31.  
  32. InitDelay = 9
  33. MinDelay = 2
  34. Buildup = 0.005
  35. InitDamage = 20
  36. DBuildup = 0.005
  37. #
  38.  
  39. Delay = InitDelay
  40. Damage = InitDamage
  41.  
  42. #Who designed these to make it not work when duped??? -Cheese
  43.  
  44. #Box and origin
  45. holoCreate(1,entity():pos(),vec(),entity():angles():setYaw(180 + owner():eyeAngles():yaw()))
  46. holoParent(1,entity())
  47. holoCreate(2,holoEntity(1):pos(),vec(2,5,1/24),holoEntity(1):angles(),Color[1,vector])
  48. holoParent(2,1)
  49. holoCreate(103,holoEntity(1):toWorld(vec(11.75,0,0)),vec(),holoEntity(1):toWorld(ang()))
  50. holoParent(103,2)
  51. holoCreate(3,holoEntity(1):toWorld(vec(11.75,0,12)),vec(1/24,5,2),holoEntity(1):toWorld(ang()),Color[1,vector])
  52. holoAlpha(103,0)
  53. holoParent(3,103)
  54. holoCreate(104,holoEntity(1):toWorld(vec(-11.75,0,0)),vec(),holoEntity(1):toWorld(ang(0,180,0)))
  55. holoAlpha(104,0)
  56. holoParent(104,2)
  57. holoCreate(4,holoEntity(1):toWorld(vec(-11.75,0,12)),vec(1/24,5,2),holoEntity(1):toWorld(ang()),Color[1,vector])
  58. holoParent(4,104)
  59. holoCreate(105,holoEntity(1):toWorld(vec(0,29.75,0)),vec(),holoEntity(1):toWorld(ang(0,90,0)))
  60. holoAlpha(105,0)
  61. holoParent(105,2)
  62. holoCreate(5,holoEntity(1):toWorld(vec(0,29.75,12)),vec(23/12,1/24,2),holoEntity(1):toWorld(ang()),Color[1,vector])
  63. holoParent(5,105)
  64. holoCreate(106,holoEntity(1):toWorld(vec(0,-29.75,0)),vec(),holoEntity(1):toWorld(ang(0,-90,0)))
  65. holoAlpha(106,0)
  66. holoParent(106,2)
  67. holoCreate(6,holoEntity(1):toWorld(vec(0,-29.75,12)),vec(23/12,1/24,2),holoEntity(1):toWorld(ang()),Color[1,vector])
  68. holoParent(6,106)
  69. 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))
  70. holoModel(7,"hq_cylinder")
  71. holoParent(7,3)
  72. 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))
  73. holoModel(8,"hq_cylinder")
  74. holoParent(8,3)
  75. holoCreate(108,holoEntity(3):toWorld(vec(1,0,12)),vec(),holoEntity(1):toWorld(ang()))
  76. holoAlpha(108,0)
  77. holoParent(108,8)
  78. holoCreate(9,holoEntity(1):toWorld(vec(0,0,24)),vec(2,2,5),holoEntity(1):toWorld(ang(0,0,90)),Color[1,vector])
  79. holoModel(9,"hq_tube_thin")
  80. holoClip(9,vec(0,-0.5,0),vec(0,1,0),0)
  81. holoClipEnabled(9,1)
  82. holoParent(9,108)
  83. 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])
  84. holoModel(10,"hq_cylinder")
  85. holoClip(10,vec(0,-0.5,0),vec(0,1,0),0)
  86. holoClipEnabled(10,1)
  87. holoParent(10,9)
  88. 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])
  89. holoModel(11,"hq_cylinder")
  90. holoClip(11,vec(0,-0.5,0),vec(0,1,0),0)
  91. holoClipEnabled(11,1)
  92. holoParent(11,9)
  93. 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))
  94. holoModel(12,"hq_rcube")
  95. holoParent(12,9)
  96. holoCreate(13,holoEntity(9):toWorld(vec(0,9.1,0)),vec(3/12,2,1/24),holoEntity(1):toWorld(ang()),vec(50))
  97. holoParent(13,9)
  98. 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))
  99. holoModel(14,"hqrcylinder")
  100. holoParent(14,9)
  101. 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))
  102. holoModel(15,"hqrcylinder")
  103. holoParent(15,9)
  104. 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))
  105. holoModel(16,"hqrcylinder")
  106. holoParent(16,9)
  107.  
  108. #Hull
  109. 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])
  110. holoModel(17,"hqrcylinder")
  111. holoParent(17,1)
  112. holoCreate(18,holoEntity(17):toWorld(vec(12,0,0)),vec(13/12,14/12,11/12),holoEntity(17):toWorld(ang()),Color[2,vector])
  113. holoModel(18,"hq_rcube")
  114. holoClip(18,vec(0,0,0),vec(-1,0,0),0)
  115. holoClipEnabled(18,1)
  116. holoParent(18,17)
  117. holoCreate(19,holoEntity(17):toWorld(vec(12,0,0)),-holoScale(18):setX(2/12),holoEntity(18):toWorld(ang()),vec())
  118. holoModel(19,"hq_rcube")
  119. holoClip(19,vec(0,0,0),vec(-1,0,0),0)
  120. holoClipEnabled(19,1)
  121. holoParent(19,17)
  122. holoCreate(20,holoEntity(17):toWorld(vec(0,0,1.5)),vec(15/12,15/12,10/12),holoEntity(17):toWorld(ang()),vec(65))
  123. holoModel(20,"hqrcylinder")
  124. holoParent(20,17)
  125.  
  126. #Skele
  127. holoCreate(21,holoEntity(17):toWorld(vec(12.3,0,0)),vec(1/24,15.25/12,6/12),holoEntity(17):toWorld(ang()),vec(65))
  128. holoCreate(22,holoEntity(17):toWorld(vec(9.55,7.375,0)),vec(5/12,1/24,6/12),holoEntity(17):toWorld(ang()),vec(65))
  129. holoParent(22,21)
  130. holoCreate(23,holoEntity(17):toWorld(vec(9.55,-7.375,0)),vec(5/12,1/24,6/12),holoEntity(17):toWorld(ang()),vec(65))
  131. holoParent(23,21)
  132. #V-pillar
  133. 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))
  134. holoModel(24,"hq_cylinder")
  135. holoParent(24,1)
  136. 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))
  137. holoModel(25,"hq_cylinder")
  138. holoParent(25,24)
  139. #H-pillar
  140. 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))
  141. holoModel(26,"hqrcylinder")
  142. holoParent(26,24)
  143.  
  144. #L-frame
  145. holoCreate(27,holoEntity(24):toWorld(vec(3,5.375,6)),vec(1,1/24,1),holoEntity(17):toWorld(ang(5,0,0)),vec(65))
  146. holoParent(27,26)
  147. 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))
  148. holoParent(28,27)
  149.  
  150. 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))
  151. holoModel(29,"hq_tube_thin")
  152. holoClip(29,1,vec(0,-1,0),vec(0,1,0),0)
  153. holoClipEnabled(29,1,1)
  154. holoClip(29,2,vec(1,0,0),vec(-20,3,0),0)
  155. holoClipEnabled(29,2,1)
  156. holoParent(29,27)
  157.  
  158. #R-frame
  159. holoCreate(30,holoEntity(24):toWorld(vec(3,-5.375,6)),vec(1,1/24,1),holoEntity(17):toWorld(ang(5,0,0)),vec(65))
  160. holoParent(30,26)
  161. 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))
  162. holoParent(31,30)
  163.  
  164. 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))
  165. holoModel(32,"hq_tube_thin")
  166. holoClip(32,1,vec(0,-1,0),vec(0,1,0),0)
  167. holoClipEnabled(32,1,1)
  168. holoClip(32,2,vec(1,0,0),vec(-20,3,0),0)
  169. holoClipEnabled(32,2,1)
  170. holoParent(32,30)
  171.  
  172. #L-leg
  173. holoCreate(133,holoEntity(26):toWorld(vec()),vec(),holoEntity(24):toWorld(ang()))
  174. holoAlpha(133,0)
  175. holoParent(133,24)
  176. 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))
  177. holoParent(33,133)
  178. holoClip(33,vec(-3 -0.125,0,0),vec(1,-1,0),0)
  179. holoClipEnabled(33,1)
  180. 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))
  181. holoModel(34,"hq_cylinder")
  182. holoParent(34,33)
  183. holoCreate(35,holoEntity(34):toWorld(vec(11 +0.125,0,0)),vec(22/12,1/24,2/12),holoEntity(34):toWorld(ang()),vec(45))
  184. holoParent(35,34)
  185. 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))
  186. holoModel(36,"hq_cylinder")
  187. holoParent(36,35)
  188. holoCreate(37,holoEntity(36):toWorld(vec(0,0,-0.8)),vec(1/12),holoEntity(34):toWorld(ang(0,0,0)),vec(45))
  189. holoModel(37,"hqsphere")
  190. holoParent(37,36)
  191. 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))
  192. holoModel(38,"hq_cylinder")
  193. holoParent(38,37)
  194. holoAng(34,holoEntity(34):toWorld(ang(0,-10,0)))
  195.  
  196. #R-leg
  197. 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))
  198. holoClip(39,vec(-3 -0.125,0,0),vec(1,1,0),0)
  199. holoClipEnabled(39,1)
  200. holoParent(39,133)
  201. 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))
  202. holoModel(40,"hq_cylinder")
  203. holoParent(40,39)
  204. holoCreate(41,holoEntity(40):toWorld(vec(11 +0.125,0,0)),vec(22/12,1/24,2/12),holoEntity(40):toWorld(ang()),vec(45))
  205. holoParent(41,40)
  206. 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))
  207. holoModel(42,"hq_cylinder")
  208. holoParent(42,41)
  209. holoCreate(43,holoEntity(42):toWorld(vec(0,0,-0.8)),vec(1/12),holoEntity(40):toWorld(ang(0,0,0)),vec(45))
  210. holoModel(43,"hqsphere")
  211. holoParent(43,42)
  212. 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))
  213. holoModel(44,"hq_cylinder")
  214. holoParent(44,43)
  215. holoAng(40,holoEntity(40):toWorld(ang(0,-10,0)))
  216.  
  217. #Handle
  218. 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))
  219. holoParent(45,26)
  220. 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))
  221. holoParent(46,26)
  222. 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))
  223. holoModel(47,"hq_cylinder")
  224. holoParent(47,26)
  225.  
  226. #Hull control
  227. holoCreate(48,holoEntity(24):toWorld(vec(-2.25,0,12)),vec(2/12),holoEntity(1):toWorld(ang(-45,90,0)),vec(65))
  228. holoModel(48,"hq_sphere")
  229. Length1 = 5
  230. Length2 = 8
  231. 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))
  232. holoModel(49,"hq_cylinder")
  233. holoCreate(50,holoEntity(49):toWorld(vec(0,0,(Length1/2)+0.5)),vec(2/12),holoEntity(49):toWorld(ang(-90,0,0)),vec(65))
  234. holoModel(50,"hq_sphere")
  235. 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))
  236. holoModel(51,"hq_cylinder")
  237. holoCreate(52,holoEntity(51):toWorld(vec(0,0,(Length2/2)+0.5)),vec(2/12),holoEntity(51):toWorld(ang(-90,0,0)),vec(65))
  238. holoModel(52,"hq_sphere")
  239. 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))
  240. holoModel(53,"hq_cylinder")
  241. holoCreate(54,holoEntity(53):toWorld(vec(0,0,(Length2/2)+0.5)),vec(2/12),holoEntity(53):toWorld(ang(-90,0,0)),vec(65))
  242. holoModel(54,"hq_sphere")
  243.  
  244. for(H = 49,54){
  245. holoParent(H,H-1)
  246. }
  247. holoParent(48,24)
  248.  
  249. #[
  250. #unused diamond 2-limb ik method
  251. holoAng(48,holoEntity(24):(holoEntity(17):toWorld(vec(0,0,-6)) - holoEntity(48):pos()):toAngle())
  252. holoAng(48,holoEntity(48):toWorld(ang(-45,0,0)))
  253.  
  254. IK1 = holoEntity(24):toLocal(holoEntity(50):pos())
  255. IK2 = holoEntity(24):toLocal(holoEntity(17):toWorld(vec(0,0,-6)))
  256. IK = vec2(IK2:x(),IK2:z())-vec2(IK1:x(),IK1:z())
  257. IK_r = sqrt(IK:x()^2 + IK:y()^2)
  258. IK_a = Length2 + 1
  259.  
  260. holoAng(50,(holoEntity(17):toWorld(vec(0,0,-6)) - holoEntity(50):pos()):toAngle())
  261. holoAng(50,holoEntity(50):toWorld(ang(-acos(IK_r/2/IK_a),0,0)))
  262. ]#
  263.  
  264. IK_ang = (holoEntity(24):toLocal(holoEntity(17):toWorld(vec(0,0,-6))) - holoEntity(24):toLocal(holoEntity(48):pos())):toAngle()+ang(30,0,0)
  265. holoAng(48,holoEntity(24):toWorld(IK_ang))
  266.  
  267. IK1 = holoEntity(24):toLocal(holoEntity(50):pos())
  268. IK2 = holoEntity(24):toLocal(holoEntity(17):toWorld(vec(0,0,-6)))
  269. IK = vec2(IK2:x(),IK2:z())-vec2(IK1:x(),IK1:z())
  270. IK_r = sqrt(IK:x()^2 + IK:y()^2)
  271. IK_a = Length2 + 1
  272. IK_theta1 = IK_ang:pitch() - 270 - (acos(IK:y()/IK_r) + acos(((IK_r*IK_r)/(2*IK_a*IK_r))))
  273. IK_theta2 = 180 - acos(((IK_a^2)*2-(IK_r^2))/(2*(IK_a^2)))
  274.  
  275. holoAng(50,holoEntity(48):toWorld(ang(-IK_theta1,0,0)))
  276. holoAng(52,holoEntity(50):toWorld(ang(-IK_theta2,0,0)))
  277.  
  278. #[
  279. #Failed 3-limb ik
  280. IK1 = vec(-2.25,0,12)
  281. IK2 = holoEntity(24):toLocal(holoEntity(17):toWorld(vec(0,0,-6)))
  282.  
  283. IK_a1 = Length1 + 1
  284. IK_a2 = Length2 + 1
  285.  
  286. IK = vec2(IK2:x(),IK2:z())-vec2(IK1:x(),IK1:z())
  287. IK_r1 = (vec2():distance(IK))/2
  288.  
  289. IK_phi1 = 180/(1+(2*IK_a2/IK_a1))
  290. IK_phi2 = 180/(2+(IK_a1/IK_a2))
  291.  
  292. IK_phi3 = asin(7.9*sin(IK_phi1)/IK_a1)
  293. IK_phi7 = abs(atan(IK:x()/IK:y()))
  294. IK_theta1 = 180 - IK_phi1 - IK_phi3 + IK_phi7
  295.  
  296. IK_r2 = sqrt((IK_r1^2) + (IK_a1^2) - (2*IK_r1*IK_a1*cos(180 - IK_phi1 - IK_phi3)))
  297. IK_phi5 = asin((IK_r2*sin(IK_phi2))/IK_a2)
  298. IK_phi4 = 180 - IK_phi2 - IK_phi5
  299. IK_theta2 = 180 - IK_phi3 - IK_phi4
  300.  
  301. IK_phi6 = asin((IK_r1*sin(IK_phi2))/IK_a2)
  302. IK_theta3 = 180 - IK_phi5 - IK_phi6
  303.  
  304.  
  305. IK_print1 = IK_phi1:toString()+", "+IK_phi2:toString()+", "+IK_phi3:toString()+", "+IK_phi7:toString()
  306. IK_print2 = IK_phi4:toString()+", "+IK_phi5:toString()+", "+IK_phi6:toString()
  307. IK_print3 = IK_theta1:toString()+", -"+IK_theta2:toString()+", -"+IK_theta3:toString()
  308. #print(IK)
  309. #print(asin(IK_r1*sin(IK_phi1)/IK_a1))
  310. #print(IK_r1)
  311. #print(holoEntity(48):pos():distance(holoEntity(50):pos()))
  312. print("Phi 1,2,3,7: "+IK_print1)
  313. print("Phi 4,5,6: "+IK_print2)
  314. print("Theta 1,2: "+IK_print3)
  315.  
  316. holoAng(48,holoEntity(24):toWorld(ang(-90-IK_theta1,0,0)))
  317. holoAng(50,holoEntity(48):toWorld(ang(IK_theta2,0,0)))
  318. holoAng(52,holoEntity(50):toWorld(ang(IK_theta3,0,0)))
  319. ]#
  320.  
  321. holoParent(17,24)
  322.  
  323. #V-pillar top
  324. holoCreate(55,holoEntity(24):toWorld(vec(0,0,15)),vec(4.5/12),holoEntity(24):toWorld(ang()),vec(65))
  325. holoModel(55,"hq_sphere")
  326. holoParent(55,24)
  327. holoCreate(156,holoEntity(55):toWorld(vec(0,0,1)),vec(),holoEntity(24):toWorld(ang()))
  328. holoParent(156,55)
  329. holoCreate(56,holoEntity(156):toWorld(vec()),vec(1.5/12,1.5/12,8/12),holoEntity(17):toWorld(ang(0,0,90)),vec(65))
  330. holoModel(56,"hq_cylinder")
  331. holoParent(56,156)
  332. #
  333. holoCreate(57,holoEntity(56):toWorld(vec(0,0,3.5)),vec(2/12,2/12,1/12),holoEntity(56):toWorld(ang()),vec(45))
  334. holoModel(57,"hq_tube")
  335. holoParent(57,56)
  336. 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))
  337. holoParent(58,57)
  338.  
  339. holoCreate(59,holoEntity(56):toWorld(vec(0,0,-3.5)),vec(2/12,2/12,1/12),holoEntity(56):toWorld(ang()),vec(45))
  340. holoModel(59,"hq_tube")
  341. holoParent(59,56)
  342. 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))
  343. holoParent(60,59)
  344.  
  345. holoParent(21,156)
  346.  
  347. #Extension legs
  348. #28,31
  349. 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")
  350. holoParent(61,28)
  351. 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")
  352. 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")
  353. holoParent(63,31)
  354. 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")
  355.  
  356. 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))
  357. holoParent(62,65)
  358. holoParent(64,65)
  359. holoParent(65,26)
  360.  
  361. 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")
  362. holoParent(66,65)
  363. 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")
  364. holoParent(67,65)
  365.  
  366. #Hull_front
  367. #/2-4 extend,/2 inside
  368. 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")
  369. holoClip(68,vec(holoScale(68):x()*6 - 0.3,0,0),vec(-1,0,0),0)
  370. holoClipEnabled(68,1)
  371. holoParent(68,18)
  372. #nice
  373. holoCreate(69,holoEntity(68):pos(),-holoScale(68),holoEntity(68):toWorld(ang()),vec(65),"hqrcube")
  374. holoClip(69,vec(holoScale(68):x()*6 - 0.3,0,0),vec(-1,0,0),0)
  375. holoClipEnabled(69,1)
  376. holoParent(69,68)
  377. 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])
  378. holoParent(70,68)
  379.  
  380. entity():setMaterial("models/wireframe")
  381.  
  382. for(H = 1,70){
  383. holoAlpha(H,0)
  384. }
  385.  
  386. E156 = noentity()
  387. X = 0
  388. Up24 = 0
  389. Len_38_44 = 0
  390. P_38_44 = 0
  391. X4 = 0
  392. Target = noentity()
  393. X3 = 0
  394. X2 = 0
  395. }
  396. else{
  397. if(changed(first())){
  398. for(H = 1,70){
  399. holoAlpha(H,255)
  400.  
  401. ColorBlue:clear()
  402. ColorOrange:clear()
  403. ColorRed:clear()
  404. }
  405. }
  406.  
  407. if(X <= 600){
  408. X += 1
  409.  
  410. if(X >= 50 & X < 61){
  411. for(H = 103,106){
  412. holoAng(H,holoEntity(H):toWorld(ang(8,0,0)))
  413. }
  414. }
  415.  
  416. if(X >= 61 & X < 65){
  417. holoAng(108,holoEntity(108):toWorld(ang(5,0,0)))
  418. }
  419. elseif(X >= 70 & X < 160){
  420. holoPos(24,holoEntity(24):pos() + holoEntity(1):toWorld(vec(0,14.43374803/90,6.25/90)) - holoEntity(1):pos())
  421. holoAng(24,holoEntity(1):toWorld(ang(84*(1 - ((X-70) / 90)),90 + 90*((X-70) / 90),0)))
  422. }
  423. elseif(X >= 163 & X < 208){
  424. holoAng(34,holoEntity(34):toWorld(ang(0,-3,0)))
  425. holoAng(40,holoEntity(40):toWorld(ang(0,-3,0)))
  426. }
  427. elseif(X >= 213 & X < 246){
  428. holoAng(133,holoEntity(133):toWorld(ang(3,0,0)))
  429. }
  430. elseif(X >= 249 & X < 279){
  431. holoAng(37,holoEntity(37):angles():setPitch(holoEntity(1):angles():pitch()+90))
  432. holoAng(43,holoEntity(43):angles():setPitch(holoEntity(1):angles():pitch()+90))
  433.  
  434. Up24 += (8/29)
  435. holoPos(24,holoEntity(26):pos() + holoEntity(24):up()*Up24)
  436. holoAng(24,holoEntity(1):toWorld(ang(0,180,0)))
  437. holoPos(26,holoEntity(133):pos())
  438. holoAng(26,holoEntity(26):toWorld(ang(0,1.6,0)))
  439. 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)))))
  440. holoAng(133,(holoEntity(3844):pos() - holoEntity(133):pos()):toAngle()+ang(53,0,0))
  441. }
  442. elseif(X >= 279 & X < 287){
  443. holoPos(65,holoEntity(65):toWorld(vec(0,0,-1)))
  444. }
  445. elseif(X >= 283 & X < 313){
  446. holoAng(37,holoEntity(37):angles():setPitch(holoEntity(1):angles():pitch()+90))
  447. holoAng(43,holoEntity(43):angles():setPitch(holoEntity(1):angles():pitch()+90))
  448.  
  449. Up24 -= (8/29)
  450. holoPos(24,holoEntity(26):pos() + holoEntity(24):up()*Up24)
  451. holoAng(24,holoEntity(1):toWorld(ang(0,180,0)))
  452. holoPos(26,holoEntity(133):pos())
  453. holoAng(26,holoEntity(26):toWorld(ang(0,0.26,0)))
  454. 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)))))
  455. holoAng(133,(holoEntity(3844):pos() - holoEntity(133):pos()):toAngle()+ang(53,0,0))
  456. }
  457. elseif(X >= 320 & X < 440){
  458. holoPos(24,holoEntity(24):toWorld(vec(0,0,0.025)))
  459. holoAng(24,holoEntity(24):toWorld(ang(0,6,0)))
  460. }
  461. elseif(X >= 445 & X < 486){
  462. holoPos(17,holoEntity(17):pos() + holoEntity(24):toWorld(vec(-0.5,0,0))-holoEntity(24):pos())
  463. holoAng(17,holoEntity(17):toWorld(ang(-95/40,0,0)))
  464.  
  465. IK_ang = (holoEntity(24):toLocal(holoEntity(17):toWorld(vec(0,0,-6))) - holoEntity(24):toLocal(holoEntity(48):pos())):toAngle()+ang(30,0,0)
  466. holoAng(48,holoEntity(24):toWorld(IK_ang))
  467.  
  468. IK1 = holoEntity(24):toLocal(holoEntity(50):pos())
  469. IK2 = holoEntity(24):toLocal(holoEntity(17):toWorld(vec(0,0,-6)))
  470. IK = vec2(IK2:x(),IK2:z())-vec2(IK1:x(),IK1:z())
  471. IK_r = sqrt(IK:x()^2 + IK:y()^2)
  472. IK_a = Length2 + 1
  473. IK_theta1 = IK_ang:pitch() - 270 - (acos(IK:y()/IK_r) + acos(((IK_r*IK_r)/(2*IK_a*IK_r))))
  474. IK_theta2 = 180 - acos(((IK_a^2)*2-(IK_r^2))/(2*(IK_a^2)))
  475.  
  476. holoAng(50,holoEntity(48):toWorld(ang(-IK_theta1,0,0)))
  477. holoAng(52,holoEntity(50):toWorld(ang(-IK_theta2,0,0)))
  478. }
  479. elseif(X >= 486 & X < 493){
  480. holoPos(68,holoEntity(68):toWorld(vec(1.83,0,0)))
  481. }
  482. elseif(X >= 495 & X < 511){
  483. holoPos(17,holoEntity(17):pos() + holoEntity(24):toWorld(vec(2/16,0,-6.5/16))-holoEntity(24):pos())
  484. holoAng(17,holoEntity(17):toWorld(ang(7.5/16,0,0)))
  485.  
  486. IK_ang = (holoEntity(24):toLocal(holoEntity(17):toWorld(vec(0,0,-6))) - holoEntity(24):toLocal(holoEntity(48):pos())):toAngle()+ang(45,0,0)
  487. holoAng(48,holoEntity(24):toWorld(IK_ang))
  488.  
  489. IK1 = holoEntity(24):toLocal(holoEntity(50):pos())
  490. IK2 = holoEntity(24):toLocal(holoEntity(17):toWorld(vec(0,0,-6)))
  491. IK = vec2(IK2:x(),IK2:z())-vec2(IK1:x(),IK1:z())
  492. IK_r = sqrt(IK:x()^2 + IK:y()^2)
  493. IK_a = Length2 + 1
  494. IK_theta1 = IK_ang:pitch() - 270 - (acos(IK:y()/IK_r) + acos(((IK_r*IK_r)/(2*IK_a*IK_r))))
  495. IK_theta2 = 180 - acos(((IK_a^2)*2-(IK_r^2))/(2*(IK_a^2)))
  496.  
  497. holoAng(50,holoEntity(48):toWorld(ang(-IK_theta1,0,0)))
  498. holoAng(52,holoEntity(50):toWorld(ang(-IK_theta2,0,0)))
  499. }
  500. elseif(X >= 521 & X < 532){
  501. holoColor(87,holoEntity(87):getColor()+vec(10,0,0))
  502. }
  503.  
  504. if(X == 247){
  505. holoAng(37,holoEntity(37):angles():setPitch(holoEntity(1):angles():pitch()+90))
  506. holoAng(43,holoEntity(43):angles():setPitch(holoEntity(1):angles():pitch()+90))
  507.  
  508. V_38_44 = (holoEntity(38):boxCenterW() + holoEntity(44):boxCenterW())/2
  509. Len_38_44 = V_38_44:distance(holoEntity(133):boxCenterW())
  510. holoCreate(3844,V_38_44,vec(1/12),holoEntity(1):angles())
  511. holoAlpha(3844,0)
  512. holoParent(3844,1)
  513. A_38_44 = holoEntity(3844):toLocal((holoEntity(133):pos() - holoEntity(3844):pos()):toAngle())
  514. P_38_44 = A_38_44:pitch()
  515.  
  516. Up24 = holoEntity(1):toLocal(holoEntity(24):pos()):z() - holoEntity(1):toLocal(holoEntity(26):pos()):z()
  517.  
  518. holoUnparent(24)
  519. holoUnparent(26)
  520. holoUnparent(133)
  521.  
  522. holoParent(24,26)
  523. holoParent(133,3844)
  524. }
  525. elseif(X == 279){
  526. holoUnparent(133)
  527. }
  528. elseif(X == 280){
  529. A_38_44 = holoEntity(3844):toLocal((holoEntity(133):pos() - holoEntity(3844):pos()):toAngle())
  530. P_38_44 = A_38_44:pitch()
  531. }
  532. elseif(X == 313){
  533. holoDelete(3844)
  534. holoUnparent(133)
  535. holoUnparent(26)
  536. holoUnparent(33)
  537. holoUnparent(39)
  538. holoParent(24,1)
  539. holoParent(26,1)
  540. holoParent(33,1)
  541. holoParent(39,1)
  542. holoParent(133,1)
  543. }
  544. elseif(X == 442){
  545. #Tube
  546. 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")
  547. holoParent(71,70)
  548. 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")
  549. holoParent(72,71)
  550. holoCreate(172,holoEntity(72):pos(),vec(),holoEntity(18):toWorld(ang()))
  551. holoAlpha(172,0)
  552. holoParent(172,72)
  553. 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")
  554. holoParent(73,71)
  555. 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")
  556. holoClip(74,vec(1,0,0),vec(1,0,0),0)
  557. holoClipEnabled(74,1)
  558. holoParent(74,73)
  559. 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")
  560. holoClip(75,vec(-1,0,0),vec(-1,0,0),0)
  561. holoClipEnabled(75,1)
  562. holoParent(75,73)
  563. #Clip covers......
  564. 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))
  565. holoParent(76,74)
  566. 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))
  567. holoParent(77,74)
  568. 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))
  569. holoParent(78,74)
  570. 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))
  571. holoParent(79,74)
  572. 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")
  573. holoParent(80,73)
  574. #Camera and light
  575. 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")
  576. holoParent(81,70)
  577. 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")
  578. holoParent(82,70)
  579. 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))
  580. holoParent(83,70)
  581. 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")
  582. holoParent(84,70)
  583. 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")
  584. holoParent(85,81)
  585. 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")
  586. holoParent(86,82)
  587. 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")
  588. holoParent(87,84)
  589. 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))
  590. holoParent(88,85)
  591.  
  592. holoUnparent(17)
  593. holoParent(17,156)
  594.  
  595. for(H = 71,90){
  596. holoAlpha(H,0)
  597. }
  598. }
  599. elseif(X == 485){
  600. for(H = 71,90){
  601. holoAlpha(H,255)
  602. }
  603. }
  604. elseif(X == 512){
  605. for(H = 2,12){
  606. holoDelete(H)
  607. }
  608.  
  609. findClearWhitePlayerPropList()
  610.  
  611. findIncludeClass("player")
  612. findIncludeClass("npc_*")
  613. }
  614. }
  615. else{
  616. IK_offset0 = holoEntity(24):toLocal(holoEntity(17):toWorld(vec(0,0,-6))) - holoEntity(24):toLocal(holoEntity(48):pos())
  617. if(IK_offset0:x() >= 0){
  618. IK_ang0 = IK_offset0:toAngle():setYaw(180):setPitch(270-IK_offset0:toAngle():pitch()+270)
  619. }
  620. else{
  621. IK_ang0 = IK_offset0:toAngle()
  622. }
  623.  
  624. if(IK_ang0:pitch() >= 270){
  625. if(IK_ang0:pitch() <= 315){
  626. IK_ang = IK_ang0 + ang(45-(310-IK_ang0:pitch()),0,0)
  627. }
  628. else{
  629. IK_ang = IK_ang0 + ang(45,0,0)
  630. }
  631. }
  632. elseif(IK_ang0:pitch() <= 90){
  633. IK_ang = IK_ang0 + ang(45-IK_ang0:pitch(),0,0)
  634. }
  635. else{
  636. IK_ang = ang(270,180,0)
  637. }
  638.  
  639. holoAng(48,holoEntity(24):toWorld(IK_ang))
  640.  
  641. IK1 = holoEntity(24):toLocal(holoEntity(50):pos())
  642. IK2 = holoEntity(24):toLocal(holoEntity(17):toWorld(vec(0,0,-6)))
  643. IK = vec2(abs(IK2:x()-IK1:x()),abs(IK2:z()-IK1:z()))
  644. IK_r = sqrt(IK:x()^2 + IK:y()^2)
  645. IK_a = Length2 + 1
  646. if(IK_ang:pitch() == 270){
  647. IK_theta1 = 90 - (acos(IK:x()/IK_r) + acos(((IK_r*IK_r)/(2*IK_a*IK_r))))
  648. }
  649. else{
  650. IK_theta1 = IK_ang:pitch() - 270 - (acos(IK:y()/IK_r) + acos(((IK_r*IK_r)/(2*IK_a*IK_r))))
  651. }
  652. IK_theta2 = 180 - acos(((IK_a^2)*2-(IK_r^2))/(2*(IK_a^2)))
  653.  
  654. holoAng(50,holoEntity(48):toWorld(ang(-IK_theta1,0,0)))
  655. holoAng(52,holoEntity(50):toWorld(ang(-IK_theta2,0,0)))
  656.  
  657. X4 += 1
  658.  
  659. if(CCFilter == 1){
  660. if(changed(CCEntity)){
  661. if(CCEntity:isValid()){
  662. Delay = InitDelay
  663. Damage = InitDamage
  664.  
  665. Lose = 0
  666. }
  667. }
  668.  
  669. if(CCEntity:isValid()){
  670. Aiming = CCEntity:boxCenterW()+Target:vel()*0.2
  671.  
  672. X3 += 1
  673.  
  674. if(Delay - Buildup < MinDelay){
  675. Delay = MinDelay
  676. }
  677. elseif(Delay - Buildup > MinDelay){
  678. Delay -= Buildup
  679. }
  680.  
  681. if(X3%round(Delay) == 0){
  682. Fire = 1
  683. }
  684. else{
  685. Fire = 0
  686. }
  687.  
  688. Damage += DBuildup
  689. }
  690. else{
  691. 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))
  692.  
  693. Fire = 0
  694. }
  695. }
  696. else{
  697. if(changed(Target)){
  698. if(Target:isValid()){
  699. Delay = InitDelay
  700. Damage = InitDamage
  701.  
  702. Lose = 0
  703. }
  704. }
  705.  
  706. if(Target:isValid()){
  707. if(!Target:isAlive()){
  708. Target = noentity()
  709. 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))
  710. }
  711. else{
  712. Aiming = Target:boxCenterW()+Target:vel()*0.2
  713.  
  714. X3 += 1
  715.  
  716. if(Delay - Buildup < MinDelay){
  717. Delay = MinDelay
  718. }
  719. elseif(Delay - Buildup > MinDelay){
  720. Delay -= Buildup
  721. }
  722.  
  723. if(X3%round(Delay) == 0){
  724. Fire = 1
  725. }
  726. else{
  727. Fire = 0
  728. }
  729.  
  730. Damage += DBuildup
  731.  
  732. rangerFilter(entity())
  733. rangerFilter(Turret)
  734.  
  735. if(rangerOffset(holoEntity(172):pos(),Target:boxCenterW()):entity() != Target & rangerOffset(holoEntity(172):pos(),Target:shootPos()):entity() != Target){
  736. Lose += 1
  737. }
  738.  
  739. if(Target:boxCenterW():distance(holoEntity(156):pos()) >= LoseRange){
  740. Lose += 1
  741. }
  742.  
  743. if(Lose >= 15){
  744. Target = noentity()
  745. }
  746. }
  747. }
  748. else{
  749. 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))
  750.  
  751. Fire = 0
  752.  
  753. findInSphere(holoEntity(156):pos(),Range)
  754. findSortByDistance(holoEntity(156):pos())
  755.  
  756. rangerFilter(entity())
  757. rangerFilter(Turret)
  758.  
  759. foreach(EntI,Ent:entity = findToArray()){
  760. if(Ent != owner() & Ent:isValid() & (rangerOffset(holoEntity(172):pos(),Ent:boxCenterW()):entity() == Ent|rangerOffset(holoEntity(172):pos(),Ent:shootPos()):entity() == Ent)){
  761. Target = Ent
  762. break
  763. }
  764. else{
  765. continue
  766. }
  767. }
  768. }
  769. }
  770.  
  771. A = (holoEntity(24):toLocal(Aiming)-holoEntity(24):toLocal(holoEntity(172):pos())):toAngle()
  772. holoAng(24,holoEntity(24):toWorld(A:setPitch(0):setRoll(0)))
  773.  
  774. A2 = (holoEntity(24):toLocal(Aiming)-holoEntity(24):toLocal(holoEntity(172):pos())):toAngle()
  775. if(A2:pitch() <= -30){
  776. holoAng(156,holoEntity(24):toWorld(ang(-30,0,0)))
  777. }
  778. else{
  779. holoAng(156,holoEntity(24):toWorld(A2:setYaw(0):setRoll(0)))
  780. }
  781.  
  782. if(Turret:isValid()){
  783. if(!Turret:isFrozen()){
  784. TurretPos = holoEntity(172):toWorld(vec(0,0,0))
  785. Turret:applyForce(((TurretPos - Turret:boxCenterW())*5 - Turret:vel()*0.4)*Turret:mass())
  786. TurretAng = holoEntity(172):angles()
  787. TurretL = Turret:toLocal(rotationVector(quat(TurretAng)/quat(Turret)) + Turret:pos())
  788. Turret:applyTorque((TurretL*300-Turret:angVelVector()*40)*Turret:inertia())
  789.  
  790. X2 += 1
  791. if(X2%20 == 1){
  792. Turret:setMass(2000)
  793. Turret:setMaterial("")
  794. Turret:setColor(vec(255))
  795. Turret:setAlpha(0)
  796. }
  797. }
  798. else{
  799. X2 += 1
  800. if(X2%20 == 1){
  801. Turret:setMass(2000)
  802. Turret:setMaterial("models/wireframe")
  803. Turret:setColor(vec(255,0,0))
  804. Turret:setAlpha(255)
  805. }
  806. }
  807. }
  808. }
  809.  
  810. if(holoEntity(156):isValid()){
  811. E156 = holoEntity(156)
  812. }
  813. else{
  814. E156 = noentity()
  815. }
  816. }
  817.  
Advertisement
Add Comment
Please, Sign In to add comment