Advertisement
Guest User

Untitled

a guest
Aug 25th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.89 KB | None | 0 0
  1. @name Yaka Arrow
  2. @persist [Prop,E,O,Target,Holo,Chest]:entity Targets:table [Off,Threat,Attack,Mode,Idle,Num,Timer,Z,SortOut]
  3. @persist [Forward,RedGlow]:vector [Modes,Infos,ArrayTargets,Sort]:array Ranger:ranger
  4.  
  5. runOnTick(1)
  6.  
  7. if(first()|dupefinished()) {
  8. E = entity()
  9. O = owner()
  10. Off = 1
  11. Idle = 1
  12. Prop = propSpawn("models/props_c17/tools_wrench01a.mdl",0)
  13. Prop:setAlpha(0)
  14. Prop:propGravity(0)
  15. Prop:setMass(50000)
  16. Mode = 0
  17. Threat = 0
  18. Num = 1
  19. Z = 1
  20. Modes = array("Single Target (Threat)", "Attack Target", "Group Selection", "Large Area Selection", "Front View Selection")
  21. Infos = array("Use to threat the target, the arrow will float around the target's head ready to kill him; Press E on someone to make the arrow float and point at him, press E once again to kill him or ALT to retreave the arrow.",
  22. "It will go to the position you are looking at, it will have no target but you can kill manually, hold E to make it move where you are aiming, release to make it go back.", "Select groups of targets, after killing the current target it will go for the next one, hold E while moving your mouse to select all the targets and release the button to send the arrow.",
  23. "Same as Group Selection, but selects all the targets around an area of about 6 meters of radius where you are aiming at, hold your E key to start selecting the targets and release it to send the arrow.",
  24. "Will select everyone in your field of view in a range of about 50 meters from you, press your E key once to release the arrow.")
  25. E:propNotSolid(1)
  26. E:setAlpha(0)
  27. #MainHolo#
  28. holoCreate(42)
  29. holoPos(42,Prop:pos())
  30. holoAng(42,Prop:angles())
  31. holoParent(42,Prop)
  32. holoAlpha(42,0)
  33. holoCreate(44)
  34. holoPos(44,O:attachmentPos("chest")) #This is some utter bullshit, i tried everything to fix the problem with the attachmentPos function but for some stupid reason this works, i hate my job
  35. holoAng(44,O:attachmentAng("chest"))
  36. holoParentAttachment(44,O,"chest")
  37. holoAlpha(44,0)
  38. holoCreate(43)
  39. holoPos(43,holoEntity(44):pos())
  40. holoAng(43,O:attachmentAng("chest"))
  41. holoParentAttachment(43,O,"chest")
  42. holoAlpha(43,0)
  43. Chest = holoEntity(43)
  44. ##Body##
  45. holoCreate(1)
  46. holoModel(1,"hq_cone")
  47. holoPos(1,holoEntity(42):toWorld(vec(0,-36,0)))
  48. holoAng(1,holoEntity(42):angles()+ang(0,0,90))
  49. holoParent(1,holoEntity(42))
  50. holoScale(1,vec(0.03,0.03,7))
  51. holoMaterial(1,"phoenix_storms/metal_plate")
  52. holoColor(1, vec(190))
  53. holoClipEnabled(1,1)
  54. holoClip(1, vec(0,0,-30),vec(0,0,-1),0)
  55. #########
  56. ##Head##
  57. holoCreate(2)
  58. holoModel(2,"pyramid")
  59. holoPos(2,holoEntity(42):toWorld(vec(0,-7.15,0)))
  60. holoAng(2,holoEntity(42):angles()+ang(45,0,90))
  61. holoParent(2,holoEntity(42))
  62. holoScale(2,vec(0.025,0.025,0.16))
  63. holoMaterial(2,"phoenix_storms/metal_plate")
  64. holoColor(2, vec(190))
  65. #########
  66. ##RedRing##
  67. holoCreate(3)
  68. holoModel(3,"hq_cylinder")
  69. holoPos(3,holoEntity(42):toWorld(vec(0,-6.05,0)))
  70. holoAng(3,holoEntity(42):angles()+ang(45,0,90))
  71. holoParent(3,holoEntity(42))
  72. holoScale(3,vec(0.023,0.023,0.03))
  73. holoColor(3, vec(145,0,0))
  74. #########
  75. ##YakaContainerBody1##
  76. holoCreate(4)
  77. holoModel(4,"hq_cylinder")
  78. holoPos(4,holoEntity(42):toWorld(vec(0,5.5,0.04)))
  79. holoAng(4,holoEntity(42):angles()+ang(0,0,91.1))
  80. holoParent(4,holoEntity(42))
  81. holoScale(4,vec(0.02,0.04,0.2))
  82. holoMaterial(4,"phoenix_storms/metal_plate")
  83. holoColor(4, vec(190))
  84. holoCreate(5)
  85. holoModel(5,"hq_cylinder")
  86. holoPos(5,holoEntity(42):toWorld(vec(0,5.5,-0.06)))
  87. holoAng(5,holoEntity(42):angles()+ang(0,0,88.9))
  88. holoParent(5,holoEntity(42))
  89. holoScale(5,vec(0.02,0.04,0.2))
  90. holoMaterial(5,"phoenix_storms/metal_plate")
  91. holoColor(5, vec(190))
  92. holoCreate(6)
  93. holoModel(6,"hq_sphere")
  94. holoPos(6,holoEntity(42):toWorld(vec(0,4.3,0)))
  95. holoAng(6,holoEntity(42):angles()+ang(0,0,90))
  96. holoParent(6,holoEntity(42))
  97. holoScale(6,vec(0.02,0.0431,0.2))
  98. holoMaterial(6,"phoenix_storms/metal_plate")
  99. holoColor(6, vec(190))
  100. holoCreate(7)
  101. holoModel(7,"hq_sphere")
  102. holoPos(7,holoEntity(42):toWorld(vec(0,6.7,-0.005)))
  103. holoAng(7,holoEntity(42):angles()+ang(0,0,90))
  104. holoParent(7,holoEntity(42))
  105. holoScale(7,vec(0.02,0.052,0.08))
  106. holoMaterial(7,"phoenix_storms/metal_plate")
  107. holoColor(7, vec(190))
  108. #########
  109. ##Yaka##
  110. holoCreate(8)
  111. holoModel(8,"hq_rcylinder")
  112. holoPos(8,holoEntity(42):toWorld(vec(0,5.35,-0.005)))
  113. holoAng(8,holoEntity(42):angles()+ang(0,0,90))
  114. holoParent(8,holoEntity(42))
  115. holoScale(8,vec(0.04,0.03,0.24))
  116. holoColor(8, vec(145,0,0))
  117. #########
  118. ##YakaContainerBody2##
  119. holoCreate(9)
  120. holoModel(9,"hq_cylinder")
  121. holoPos(9,holoEntity(42):toWorld(vec(0,5,-0.005)))
  122. holoAng(9,holoEntity(42):angles()+ang(0,0,90))
  123. holoParent(9,holoEntity(42))
  124. holoScale(9,vec(0.042,0.03,0.03))
  125. holoMaterial(9,"phoenix_storms/metal_plate")
  126. holoColor(9, vec(190))
  127. holoCreate(10)
  128. holoModel(10,"hq_cylinder")
  129. holoPos(10,holoEntity(42):toWorld(vec(0,5.85,-0.005)))
  130. holoAng(10,holoEntity(42):angles()+ang(0,0,90))
  131. holoParent(10,holoEntity(42))
  132. holoScale(10,vec(0.042,0.03,0.03))
  133. holoMaterial(10,"phoenix_storms/metal_plate")
  134. holoColor(10, vec(190))
  135. holoCreate(11)
  136. holoModel(11,"hq_cylinder")
  137. holoPos(11,holoEntity(42):toWorld(vec(0,6.4,-0.005)))
  138. holoAng(11,holoEntity(42):angles()+ang(0,0,90))
  139. holoParent(11,holoEntity(42))
  140. holoScale(11,vec(0.042,0.03,0.02))
  141. holoMaterial(11,"phoenix_storms/metal_plate")
  142. holoColor(11, vec(190))
  143. #########
  144. ##YakaContainerBody3##
  145. holoCreate(12)
  146. holoModel(12,"hq_sphere")
  147. holoPos(12,holoEntity(42):toWorld(vec(0,6.7,-0.005)))
  148. holoAng(12,holoEntity(42):angles()+ang(90,0,90))
  149. holoParent(12,holoEntity(42))
  150. holoScale(12,vec(0.03,0.04,0.09))
  151. holoMaterial(12,"phoenix_storms/metal_plate")
  152. holoColor(12, vec(190))
  153. holoCreate(13)
  154. holoModel(13,"hq_sphere")
  155. holoPos(13,holoEntity(42):toWorld(vec(0,4,-0.005)))
  156. holoAng(13,holoEntity(42):angles()+ang(90,0,90))
  157. holoParent(13,holoEntity(42))
  158. holoScale(13,vec(0.03,0.04,0.16))
  159. holoMaterial(13,"phoenix_storms/metal_plate")
  160. holoColor(13, vec(190))
  161. #########
  162. ##Body2##
  163. holoCreate(14)
  164. holoModel(14,"hq_cone")
  165. holoPos(14,holoEntity(42):toWorld(vec(0,12.9,-0.005)))
  166. holoAng(14,holoEntity(42):angles()+ang(0,180,90))
  167. holoParent(14,holoEntity(42))
  168. holoScale(14,vec(0.03,0.03,1))
  169. holoMaterial(14,"phoenix_storms/metal_plate")
  170. holoColor(14, vec(190))
  171. holoClipEnabled(14,1)
  172. holoClip(14,vec(0,0,-4.5),vec(0,0,-1),0)
  173. holoCreate(15)
  174. holoModel(15,"hq_sphere")
  175. holoPos(15,holoEntity(42):toWorld(vec(0,7.8,-0.005)))
  176. holoAng(15,holoEntity(42):angles()+ang(0,0,90))
  177. holoParent(15,holoEntity(42))
  178. holoScale(15,vec(0.028,0.028,0.3))
  179. holoMaterial(15,"phoenix_storms/gray_chrome")
  180. holoColor(15, vec(80))
  181. holoClipEnabled(15,1)
  182. holoClip(15,vec(0,0,-0.6),vec(0,0,-1),0)
  183. #########
  184. ##SmallRings##
  185. holoCreate(16)
  186. holoModel(16,"hq_torus_thick")
  187. holoPos(16,holoEntity(42):toWorld(vec(0,9.3,-0.005)))
  188. holoAng(16,holoEntity(42):angles()+ang(0,0,90))
  189. holoParent(16,holoEntity(42))
  190. holoScale(16,vec(0.02,0.02,0.02))
  191. holoColor(16, vec(145,0,0))
  192. holoCreate(17)
  193. holoModel(17,"hq_torus_thick")
  194. holoPos(17,holoEntity(42):toWorld(vec(0,9.55,-0.005)))
  195. holoAng(17,holoEntity(42):angles()+ang(0,0,90))
  196. holoParent(17,holoEntity(42))
  197. holoScale(17,vec(0.01,0.01,0.01))
  198. holoColor(17, vec(145,0,0))
  199. #########
  200. holoCreate(100)
  201. holoScale(100,vec())
  202. holoPos(100,O:attachmentPos("eyes"))
  203. Holo = holoEntity(100)
  204. print("To activate/disactivate it press your Left Shift and your R key, to change mode press your left/right arrow key, to print in chat the commands and how the mode you selected works, press your Down key")
  205. }
  206.  
  207. Forward = Prop:right()
  208.  
  209. ##GlowingRedEffect##
  210. RedGlow = Off ? vec(75,0,0) : vec((cos(curtime()*800)*40)+190,0,0)
  211. holoColor(3, RedGlow)
  212. holoColor(8, RedGlow)
  213. holoColor(16, RedGlow)
  214. holoColor(17, RedGlow)
  215. ############
  216.  
  217.  
  218. holoPos(100,O:attachmentPos("eyes"))
  219. holoAng(100,O:eyeAngles():setRoll(0))
  220.  
  221. if(O:keyPressed("LSHIFT")) {
  222. if(changed(O:keyPressed("R"))&O:keyPressed("R")) {
  223. Off = !Off
  224. }
  225. }
  226.  
  227. if(Off) {
  228. Prop:propNotSolid(1)
  229. }
  230.  
  231. if(!Off) {
  232. if(!Target & Mode+1!=2) {
  233. Idle = 1
  234. Threat = 0
  235. }
  236. if(Idle) {
  237. Prop:propNotSolid(1)
  238. if(!inrange(Prop:pos(),O:pos()+vec(0,0,O:height()/2)-vec(100),O:pos()+vec(0,0,O:height()/2)+vec(100))) {
  239. Prop:setAng(((Prop:pos()-(O:pos()+vec(0,0,O:height()/2))):toAngle():setRoll(-(Prop:pos()-(O:pos()+vec(0,0,O:height()/2))):toAngle():pitch()))-ang(0,90,0))
  240. Prop:setPos(Prop:pos()+Forward*50)
  241. Prop:propFreeze(1)
  242. Target = noentity()
  243. }
  244. else {
  245. Prop:propFreeze(1)
  246. Prop:propNotSolid(1)
  247. Prop:setPos(Holo:toWorld(vec(10,-20,(cos(curtime()*90)*5))))
  248. Prop:setAng(O:eyeAngles()+ang(0,90,0))
  249. Target = noentity()
  250. }
  251. }
  252. if(changed(O:keyPressed("RIGHT"))&O:keyPressed("RIGHT")) {
  253. Mode = (Mode+1)%5
  254. print(_HUD_PRINTCENTER,Modes:string(Mode+1))
  255. soundPlay(1,100,"buttons/button22.wav")
  256. }
  257. if(changed(O:keyPressed("LEFT"))&O:keyPressed("LEFT")) {
  258. Mode = (Mode-1)%5
  259. print(_HUD_PRINTCENTER,Modes:string(Mode+1))
  260. soundPlay(1,100,"buttons/button22.wav")
  261. }
  262. if(changed(O:keyPressed("DOWN"))&O:keyPressed("DOWN")) {
  263. print(_HUD_PRINTCENTER,Modes:string(Mode+1))
  264. print(" " + Infos:string(Mode+1))
  265. soundPlay(1,100,"buttons/button22.wav")
  266. }
  267. if(Mode+1 == 1) {
  268. if(changed(O:keyPressed("E"))&O:keyPressed("E")) {
  269. if(Threat == 0) {
  270. Target = O:aimEntity()
  271. if(Target:isAlive()) {
  272. Idle = 0
  273. Threat = 1
  274. Prop:setAng(((Prop:pos()-(Target:pos()+vec(0,0,Target:height()*0.7))):toAngle():setRoll(-(Prop:pos()-(Target:pos()+vec(0,0,Target:height()*0.7))):toAngle():pitch()))-ang(0,90,0))
  275. }
  276. }
  277. elseif(Threat == 1) {
  278. Prop:propFreeze(0)
  279. Prop:setAng(((Prop:pos()-(Target:pos()+vec(0,0,Target:height()/3))):toAngle():setRoll(-(Prop:pos()-(Target:pos()+vec(0,0,Target:height()/3))):toAngle():pitch()))-ang(0,90,0))
  280. Prop:propNotSolid(0)
  281. Prop:applyForce(Forward*100000000)
  282. Prop:propNotSolid(0)
  283. Threat = 0
  284. timer("Idle1",400)
  285. }
  286. }
  287. elseif(changed(O:keyPressed("LALT"))&O:keyPressed("LALT")) {
  288. Threat = 0
  289. Idle = 1
  290. }
  291. if(Threat == 1) {
  292. Prop:setAng(((Prop:pos()-(Target:pos()+vec(0,0,Target:height()*0.85))):toAngle():setRoll(-(Prop:pos()-(Target:pos()+vec(0,0,Target:height()*0.85))):toAngle():pitch()))-ang(0,90,0))
  293. Prop:setPos((((O:pos()+vec(0,0,O:height()/1.1))*0.97+(Target:pos()+vec(0,0,Target:height()/1.1))*1.03)/2)+vec(0,0,(cos(curtime()*170)*1.3)))
  294. }
  295. if(clk("Idle1")) {
  296. Idle = 1
  297. }
  298. }
  299. elseif(Mode+1 == 2) {
  300. if(inrange(Prop:pos(),O:pos()-vec(O:height()),O:pos()+vec(O:height()))) {
  301. Prop:propNotSolid(1)
  302. }
  303. else {
  304. Prop:propNotSolid(0)
  305. }
  306. if(O:keyPressed("E")) {
  307. Idle = 0
  308. if(!inrange(Prop:pos(),(O:aimPos())-vec(15),(O:aimPos()+vec(0,0,5))+vec(15))) {
  309. Prop:setAng(((Prop:pos()-(O:aimPos()+vec(0,0,5))):toAngle():setRoll(-(Prop:pos()-(O:aimPos()+vec(0,0,5))):toAngle():pitch()))-ang(0,90,0))
  310. Prop:applyForce(Forward*100000000)
  311. Prop:propFreeze(0)
  312. if(!inrange(Prop:pos(),O:pos()-vec(25,25,30),O:pos()+vec(25,25,100)) & !inrange(Prop:pos(),O:pos()-vec(O:height()),O:pos()+vec(O:height()))) {
  313. Prop:propNotSolid(0)
  314. }
  315. else {
  316. Prop:propNotSolid(1)
  317. }
  318. }
  319. else {
  320. Prop:propFreeze(1)
  321. Prop:setAng(((Prop:pos()-(O:aimPos()+vec(0,0,5))):toAngle():setRoll(-(Prop:pos()-(O:aimPos()+vec(0,0,5))):toAngle():pitch()))-ang(0,90,0))
  322. }
  323. }
  324. else {
  325. Idle = 1
  326. }
  327. }
  328. elseif(Mode+1 == 3) {
  329. if(inrange(Prop:pos(),O:pos()-vec(O:height()*2),O:pos()+vec(O:height()*2))) {
  330. Prop:propNotSolid(1)
  331. }
  332. else {
  333. Prop:propNotSolid(0)
  334. }
  335. if(O:keyPressed("E")) {
  336. if(O:aimEntity():isAlive()) {
  337. if(!Targets:exists(O:aimEntity():toString())) {
  338. Targets[O:aimEntity():toString(),entity] = O:aimEntity()
  339. ArrayTargets:insertEntity(1,O:aimEntity())
  340. print(_HUD_PRINTCENTER, ArrayTargets:count():toString() + " targets selected.")
  341. }
  342. }
  343. }
  344. else {
  345. if(changed(ArrayTargets:count()>0)) {
  346. if(ArrayTargets:count()>0) {
  347. Timer = curtime()+(0.005*ArrayTargets:count())
  348. }
  349. }
  350. if(Timer <= curtime() & Timer) {
  351. if(ArrayTargets:entity(Num):isAlive()) {
  352. Target = ArrayTargets:entity(Num)
  353. Idle = 0
  354. Prop:propFreeze(0)
  355. Prop:setAng(((Prop:pos()-(Target:pos()+vec(0,0,Target:height()/1.3))):toAngle():setRoll(-(Prop:pos()-(Target:pos()+vec(0,0,Target:height()/1.3))):toAngle():pitch()))-ang(0,90,0))
  356. if(inrange(Prop:pos(),O:pos()-vec(O:height()),O:pos()+vec(O:height()))) {
  357. Prop:propNotSolid(0)
  358. }
  359. Prop:applyForce(Forward*1000000*((Prop:pos()-Target:pos()):length()/1.5))
  360. Ranger = rangerOffset(35,Prop:pos(),Forward)
  361. rangerHitEntities(1)
  362. rangerHitWater(0)
  363. if(Ranger:hit()) {
  364. if(!Ranger:entity():isAlive()) {
  365. Prop:propNotSolid(1)
  366. if(changed(Ranger:hit())) {
  367. Prop:soundPlay(1,100,"MetalVent.ImpactHard")
  368. }
  369. }
  370. else {
  371. Prop:propNotSolid(0)
  372. }
  373. }
  374. }
  375. else {
  376. Num += 1
  377. print(_HUD_PRINTCENTER, (ArrayTargets:count()-Num+1) + " targets left.")
  378. }
  379. if(Num > ArrayTargets:count()) {
  380. Idle = 1
  381. Targets:clear()
  382. ArrayTargets:clear()
  383. Target = noentity()
  384. Num = 1
  385. Timer = 0
  386. print(_HUD_PRINTCENTER, "All targets have been killed.")
  387. }
  388. }
  389. }
  390. }
  391. elseif(Mode+1 == 4) {
  392. if(inrange(Prop:pos(),O:pos()-vec(O:height()*2),O:pos()+vec(O:height()*2))) {
  393. Prop:propNotSolid(1)
  394. }
  395. else {
  396. Prop:propNotSolid(0)
  397. }
  398. if(O:keyPressed("E")) {
  399. findInSphere(O:aimPos(),300)
  400. findIncludeClass("player")
  401. findIncludeClass("npc_*")
  402. Sort = findToArray()
  403. if(Sort:count()) {
  404. for(I=1,Sort:count()) {
  405. if(Sort:entity(I):isAlive()&!Sort:entity(I):inNoclip()) {
  406. if(!Targets:exists(Sort:entity(I):toString()) & Sort:entity(I)!=O) {
  407. Targets[Sort:entity(I):toString(),entity] = Sort:entity(I)
  408. ArrayTargets:insertEntity(1,Sort:entity(I))
  409. print(_HUD_PRINTCENTER, ArrayTargets:count():toString() + " targets selected.")
  410. }
  411. }
  412. else {
  413. Sort:removeEntity(I)
  414. }
  415. }
  416. ###DoubleCheck## The first time is not enought, this seems to work fine
  417. for(I=1,Sort:count()) {
  418. if(Sort:entity(I):isAlive()&!Sort:entity(I):inNoclip()) {
  419. if(!Targets:exists(Sort:entity(I):toString()) & Sort:entity(I)!=O) {
  420. Targets[Sort:entity(I):toString(),entity] = Sort:entity(I)
  421. ArrayTargets:insertEntity(1,Sort:entity(I))
  422. print(_HUD_PRINTCENTER, ArrayTargets:count():toString() + " targets selected.")
  423. }
  424. }
  425. else {
  426. Sort:removeEntity(I)
  427. }
  428. }
  429. }
  430. }
  431. else {
  432. if(changed(ArrayTargets:count()>0)) {
  433. if(ArrayTargets:count()>0) {
  434. Timer = curtime()+(0.005*ArrayTargets:count())
  435. }
  436. }
  437. if(Timer <= curtime() & Timer) {
  438. if(ArrayTargets:entity(Num):isAlive()&!ArrayTargets:entity(Num):inNoclip()) {
  439. Target = ArrayTargets:entity(Num)
  440. Idle = 0
  441. Prop:propFreeze(0)
  442. Prop:setAng(((Prop:pos()-(Target:pos()+vec(0,0,Target:height()/1.3))):toAngle():setRoll(-(Prop:pos()-(Target:pos()+vec(0,0,Target:height()/1.3))):toAngle():pitch()))-ang(0,90,0))
  443. if(inrange(Prop:pos(),O:pos()-vec(O:height()),O:pos()+vec(O:height()))) {
  444. Prop:propNotSolid(0)
  445. }
  446. else {
  447. Prop:propNotSolid(1)
  448. }
  449. Prop:applyForce(Forward*1000000*((Prop:pos()-Target:pos()):length()/1.5))
  450. Ranger = rangerOffset(35,Prop:pos(),Forward)
  451. rangerHitEntities(1)
  452. rangerHitWater(0)
  453. if(Ranger:hit()) {
  454. if(!Ranger:entity():isAlive()) {
  455. Prop:propNotSolid(1)
  456. if(changed(Ranger:hit())) {
  457. Prop:soundPlay(1,100,"MetalVent.ImpactHard")
  458. }
  459. }
  460. else {
  461. Prop:propNotSolid(0)
  462. }
  463. }
  464. }
  465. else {
  466. Num += 1
  467. print(_HUD_PRINTCENTER, (ArrayTargets:count()-Num+1) + " targets left.")
  468. }
  469. if(Num > ArrayTargets:count()) {
  470. Idle = 1
  471. Targets:clear()
  472. ArrayTargets:clear()
  473. Sort:clear()
  474. Target = noentity()
  475. Num = 1
  476. Timer = 0
  477. print(_HUD_PRINTCENTER, "All targets have been killed.")
  478. }
  479. }
  480. }
  481. }
  482. elseif(Mode+1 == 5) {
  483. if(inrange(Prop:pos(),O:pos()-vec(O:height()*2),O:pos()+vec(O:height()*2))) {
  484. Prop:propNotSolid(1)
  485. }
  486. else {
  487. Prop:propNotSolid(0)
  488. }
  489. if(changed(O:keyPressed("E"))&O:keyPressed("E")) {
  490. findInCone(O:shootPos(),O:eyeAngles():forward(),2500,53)
  491. findIncludeClass("player")
  492. findIncludeClass("npc_*")
  493. Sort = findToArray()
  494. }
  495. if(changed(Sort:count())) {
  496. SortOut = 1
  497. }
  498. if(SortOut == 1) {
  499. if(Sort:entity(Z):isAlive()&!Sort:entity(Z):inNoclip()) {
  500. if(!Targets:exists(Sort:entity(Z):toString()) & Sort:entity(Z)!=O) {
  501. Targets[Sort:entity(Z):toString(),entity] = Sort:entity(Z)
  502. ArrayTargets:insertEntity(1,Sort:entity(Z))
  503. Z += 1
  504. print(_HUD_PRINTCENTER, ArrayTargets:count():toString() + " targets selected.")
  505. }
  506. }
  507. else {
  508. Sort:removeEntity(Z)
  509. }
  510. }
  511. if(changed(ArrayTargets:count()) & ArrayTargets:count()) {
  512. if(ArrayTargets:count()>0) {
  513. Timer = curtime()+(0.005*Sort:count())
  514. }
  515. }
  516. if(Timer <= curtime() & Timer) {
  517. if(ArrayTargets:entity(Num):isAlive()&!ArrayTargets:entity(Num):inNoclip()) {
  518. Target = ArrayTargets:entity(Num)
  519. Idle = 0
  520. Prop:propFreeze(0)
  521. Prop:setAng(((Prop:pos()-(Target:pos()+vec(0,0,Target:height()/1.3))):toAngle():setRoll(-(Prop:pos()-(Target:pos()+vec(0,0,Target:height()/1.3))):toAngle():pitch()))-ang(0,90,0))
  522. if(inrange(Prop:pos(),O:pos()-vec(O:height()),O:pos()+vec(O:height()))) {
  523. Prop:propNotSolid(0)
  524. }
  525. else {
  526. Prop:propNotSolid(1)
  527. }
  528. Prop:applyForce(Forward*1000000*((Prop:pos()-Target:pos()):length()/1.5))
  529. Ranger = rangerOffset(35,Prop:pos(),Forward)
  530. rangerHitEntities(1)
  531. rangerHitWater(0)
  532. if(Ranger:hit()) {
  533. if(!Ranger:entity():isAlive()) {
  534. Prop:propNotSolid(1)
  535. if(changed(Ranger:hit())) {
  536. Prop:soundPlay(1,100,"MetalVent.ImpactHard")
  537. }
  538. }
  539. else {
  540. Prop:propNotSolid(0)
  541. }
  542. }
  543. }
  544. else {
  545. Num += 1
  546. print(_HUD_PRINTCENTER, (ArrayTargets:count()-Num+1) + " targets left.")
  547. }
  548. if(Num > ArrayTargets:count()) {
  549. Idle = 1
  550. Targets:clear()
  551. ArrayTargets:clear()
  552. Sort:clear()
  553. Target = noentity()
  554. Num = 1
  555. Timer = 0
  556. Z = 1
  557. SortOut = 0
  558. print(_HUD_PRINTCENTER, "All targets have been killed.")
  559. }
  560. }
  561. }
  562. if(changed(Mode)) {
  563. Idle = 1
  564. Targets:clear()
  565. ArrayTargets:clear()
  566. Sort:clear()
  567. Target = noentity()
  568. Num = 1
  569. Timer = 0
  570. Z = 1
  571. SortOut = 0
  572. }
  573. }
  574. else {
  575. Prop:setPos(Chest:toWorld(vec(0,-8.5,-5)))
  576. }
  577.  
  578.  
  579.  
  580. if(changed(Off)) {
  581. if(!Off) {
  582. holoEntity(16):setTrails(1,1,4,"trails/laser",vec(255,0,0),255)
  583. print(_HUD_PRINTCENTER,Modes:string(Mode+1))
  584. holoPos(42,Prop:pos())
  585. holoAng(42,Prop:angles())
  586. holoParent(42,Prop)
  587. Idle = 1
  588. Targets:clear()
  589. ArrayTargets:clear()
  590. Sort:clear()
  591. Target = noentity()
  592. Num = 1
  593. Timer = 0
  594. Z = 1
  595. SortOut = 0
  596. }
  597. elseif(Off) {
  598. holoEntity(16):removeTrails()
  599. holoUnparent(42)
  600. holoPos(42,Chest:toWorld(vec(0,-8.5,-5)))
  601. holoAng(42, Chest:angles()+ang(0,90,-30))
  602. holoParent(42,Chest)
  603. Prop:propNotSolid(1)
  604. }
  605. }
  606.  
  607. if(!Prop:isValid()) {
  608. E:propDelete()
  609. }
  610.  
  611. if(ops() == (maxquota()*0.9)) {
  612. Idle = 1
  613. ArrayTargets:clear()
  614. Targets:clear()
  615. Target = noentity()
  616. Num = 1
  617. Timer = 0
  618. Sort:clear()
  619. SortOut = 0
  620. Z = 1
  621. print(_HUD_PRINTCENTER,"Too many targets selected! Action aborted!")
  622. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement