Advertisement
KrazziPro

Giant Spider Mech/Radar

Jul 2nd, 2019
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.16 KB | None | 0 0
  1. @name Giant Spider Mech/Radar
  2. #
  3. #Built In Player Radar
  4. #Wire a EGP with the setting as HUD
  5. #Place a jeep seat near before spawning chip.
  6. #Suggested to adv dupe 2 save a copy.
  7. #
  8. @persist [Legs Pos Ranger StepSeq Clk Dist Step Height Hit Hitnormal]:array
  9. @persist [E Pod]:entity
  10. @persist [Vel Rot Ang A1 Compensate RandomColor]:vector
  11. @persist [LegCount GC Runtime Anim Pos_comp Up_clamp Up_mul Interval Systime Rate H Leg_ground_hit_length Ranger_z_offset RangeDist Base_height]
  12. @persist [LR FB] Length1 Length2
  13. @persist LegDistance BaseHeight HI
  14. @persist SpinUp TRM BarrelSpin SpinRatio SpinLimit Mech:table
  15. @trigger
  16. @model models/hunter/blocks/cube025x025x025.mdl
  17. #—————————————-
  18. #Start of Radar
  19. #—————————————-
  20. @inputs Parent:entity TargeterSeat:entity EGP:wirelink CamHeading:angle Find
  21. @persist TargetLoop TargetCurrent:entity TargetAngleDifference
  22. @outputs Targets:array Target:entity Heading:angle Position:vector
  23. #—————————————-
  24. #End of Radar
  25. #—————————————-
  26.  
  27. interval(140)
  28. runOnLast(1)
  29.  
  30.  
  31. if(first()){
  32.  
  33.  
  34. HI = 100 #Starting index for the hologram body
  35.  
  36. SpinRatio = 3 #How fast the gatling spins up
  37. SpinLimit = 150 #RPM limit at which the gatling starts firing
  38. TRM = (tickInterval() > 0.03 ? 2 : 1)
  39.  
  40. E = entity() #Entity Spider self
  41. E:propGravity(0) #Make Spider Gravity Zero
  42. E:setMass(50000) #Set the Mass for the Spider
  43. E:setAlpha(0) #Set the cube (E2) invis
  44.  
  45. rangerFilter(Pod) #Filter the Seat from the ranger's
  46. rangerFilter(players()) #Filter Player's from the ranger's
  47.  
  48. Length1 = 55 #Length for the foot (upper)
  49. Length2 = 80 #Length for the foot (under)
  50.  
  51.  
  52. #The color of the accessories
  53. RandomColor = hsv2rgb(vec(20*(curtime())%360,0.8,0.8)) #Random Color
  54. #RandomColor = vec(106,8,136) #Solid Color
  55.  
  56. Interval = 1 #Animation rate (inverse to Rate for better performance. EG: Interval: 50, Rate 10; Interval: 100, Rate:5)
  57.  
  58. LegCount = 8
  59. LegDistance = 1 # Distance of the legs to the chip. Higher number means smaller distance
  60. Width = 30 #Foot Distance from the spider (Width)
  61. Length = 30 #Foot Distance from the spider (Lenght)
  62. Rate = 0.65 #SystemTime Rate
  63. Compensate = vec(3) #Ranger compensate
  64. Pos_comp = Length * 2 #Velocity compensation
  65.  
  66. Ranger_z_offset = 20 #Ranger offset (z)
  67. RangeDist = 210 #Ranger Distance
  68. BaseHeight = 75 #Ranger Height
  69. Leg_ground_hit_length = 150 #Leg Ground Hit Length
  70.  
  71. Up_mul = 1 #Leg cycle Z axis multiplier
  72. Up_clamp = 5 #Leg cycle Z axis clamp
  73.  
  74.  
  75.  
  76. function entity cUnits(Index:number,Posi:vector,Scale:vector,Angle:angle,Colo:vector,Model:string,Material:string,Parent:entity,Alpha:number,Shading:number){
  77. holoCreate(Index) holoPos(Index,Posi) holoScaleUnits(Index,Scale) holoAng(Index,Angle) holoColor(Index,Colo) holoModel(Index,Model) holoMaterial(Index,Material)
  78. holoParent(Index,Parent) holoAlpha(Index,Alpha) holoDisableShading(Index,Shading)
  79. return holoEntity(Index)
  80. }
  81.  
  82. cUnits(HI,E:toWorld(vec(0,0,0)),vec(60,60,18),E:toWorld(ang(0,-90,0)),vec(60),"hq_rcylinder","models/debug/debugwhite",E,255,1)
  83. HI += 1
  84.  
  85. cUnits(HI,E:toWorld(vec(-50,0,25)),vec(88,62,36),E:toWorld(ang(15,0,0)),vec(60),"hq_icosphere","models/debug/debugwhite",E,255,1)
  86. HI += 1
  87.  
  88. cUnits(HI,E:toWorld(vec(-50,0,31)),vec(88,62,48),E:toWorld(ang(15,0,0)),vec(60),"hq_icosphere","models/debug/debugwhite",E,255,1)
  89. HI += 1
  90.  
  91. cUnits(HI,E:toWorld(vec(-50,0,40)),vec(56,19,48),E:toWorld(ang(15,0,90)),RandomColor,"hq_rcylinder","models/debug/debugwhite",E,255,1)
  92. HI += 1
  93.  
  94. cUnits(HI,E:toWorld(vec(0,0,10)),vec(64,64,46),E:toWorld(ang(0,0,0)),vec(60),"hq_icosphere","models/debug/debugwhite",E,255,1)
  95. HI += 1
  96.  
  97. cUnits(HI,E:toWorld(vec(29.5,10,10)),vec(4,10,10),E:toWorld(ang(0,17,0)),vec(180,8,8),"hq_icosphere","models/debug/debugwhite",E,255,1)
  98. HI += 1
  99.  
  100. cUnits(HI,E:toWorld(vec(29.5,-10,10)),vec(4,10,10),E:toWorld(ang(0,-17,0)),vec(180,8,8),"hq_icosphere","models/debug/debugwhite",E,255,1)
  101. HI += 1
  102.  
  103. cUnits(HI,E:toWorld(vec(25,-18.5,10)),vec(4,10,10),E:toWorld(ang(0,-37,0)),vec(180,8,8),"hq_icosphere","models/debug/debugwhite",E,255,1)
  104. HI += 1
  105.  
  106. cUnits(HI,E:toWorld(vec(25,18.5,10)),vec(4,10,10),E:toWorld(ang(0,37,0)),vec(180,8,8),"hq_icosphere","models/debug/debugwhite",E,255,1)
  107. HI += 1
  108.  
  109. #####################
  110.  
  111.  
  112. for(I = 1, LegCount)
  113. {
  114. local Cos = cos((I / LegCount) * 360 + (180 / LegCount + 90)) * Width
  115. local Sin = sin((I / LegCount) * 360 + (180 / LegCount + 90)) * Length
  116.  
  117. Legs[I, entity] = holoCreate(I, E:toWorld(vec(Cos, Sin, 0)))
  118. Pos[I, vector] = vec(Cos, Sin, 0)
  119. Step[I, vector] = vec(Cos, Sin, 0)
  120. holoScale(I, vec())
  121. holoDisableShading(I,1)
  122.  
  123. #holoParent(I, E)
  124. }
  125.  
  126. StepSeq = array(
  127. 0, 1,
  128. 2, 3,
  129. 1, 2,
  130. 3, 4
  131. )
  132.  
  133. GC = StepSeq:count()
  134.  
  135. function setupPod(Vec:vector,Ang:angle,Parent:entity){
  136.  
  137. if(!Pod){
  138. findByClass("prop_vehicle_prisoner_pod")
  139. findSortByDistance(entity():pos())
  140.  
  141. if(find():owner()==owner()){
  142. Pod = find()
  143. Pod:setMass(0)
  144. }
  145.  
  146. }else{
  147.  
  148. if(!Pod:parent()){
  149.  
  150. if(Pod){
  151. Pod:setPos(Vec)
  152. Pod:setAng(Ang)
  153. if(!Pod:isFrozen()){
  154. Pod:propFreeze(1)
  155. }
  156. timer("load",1000)
  157. }
  158.  
  159. if(clk("load")){
  160. Pod:parentTo(Parent)
  161. Pod:setAlpha(0)
  162. DonePod = 1
  163. stoptimer("load")
  164. }
  165. }
  166. }
  167. }
  168.  
  169. function void entity:iK(Index, L1, L2, Targ:entity, Scale)
  170. {
  171. Holo = (Index * 1000) + 1
  172. if(first())
  173. {
  174. for(I = Holo, Holo + 2) #Increase the number with each hologram added to the legs
  175. {
  176. holoCreate(I)
  177. holoParent(I, I - 1)
  178. holoScale(I, vec(Scale))
  179. holoColor(I,vec(60, 60, 60))
  180. holoDisableShading(I,1)
  181. holoModel(I,"hq_sphere")
  182.  
  183. if(I > Holo)
  184. {
  185. holoClipEnabled(I, 1)
  186. }
  187. }
  188.  
  189. Knee = (Index * 2000)
  190. for(KneeHolo = Knee, Knee)
  191. {
  192. holoDisableShading(KneeHolo,1)
  193. holoCreate(KneeHolo)
  194. holoScale(KneeHolo, vec(0.51))
  195. holoModel(KneeHolo, "hq_sphere")
  196. holoColor(KneeHolo, RandomColor)
  197.  
  198. }
  199.  
  200. holoCreate(Holo + 3)
  201. holoCreate(Holo + 4)
  202. holoCreate(Holo + 5)
  203. holoPos(Knee, holoEntity(Holo+2):pos())
  204. holoParent(Knee, Holo+2)
  205. holoDisableShading(Knee,1)
  206.  
  207. holoParent(Holo, This)
  208. holoParent(Holo+4, Holo+1)
  209. holoParent(Holo+3, Holo+1)
  210. holoParent(Holo+5, Holo+2)
  211. holoDisableShading(Holo,1)
  212.  
  213. holoPos(Holo, This:toWorld(Pos[Index, vector] / LegDistance))
  214.  
  215. holoClip(Holo + 1, vec(), vec(0, 0, -1), 0)
  216. holoClip(Holo + 2, vec(), vec(0, 0, 1), 0)
  217. holoScale(Holo + 1, shiftR(vec(0.5, L1 / 6, 0.5))) # Hip to knee
  218. holoScale(Holo + 2, shiftR(vec(0.5, L2 / 6, 0.5))) # Knee to foot
  219. holoScale(Holo + 3, shiftR(vec(0.55, 1, 0.55))) # Hip to knee
  220. holoScale(Holo + 4, shiftR(vec(0.55, 0.5, 0.55))) # Hip to knee
  221. holoScale(Holo + 5, shiftR(vec(0.55, 0.5, 0.55))) # Hip to knee
  222.  
  223.  
  224. holoModel(Holo+1,"hq_cylinder")
  225. holoModel(Holo+2,"hq_sphere")
  226. holoModel(Holo+3,"hq_cylinder")
  227. holoModel(Holo+4,"hq_cylinder")
  228. holoModel(Holo+5,"hq_cylinder")
  229.  
  230. holoColor(Holo+3,RandomColor)
  231. holoDisableShading(Holo+3,1)
  232. holoColor(Holo+4,RandomColor)
  233. holoDisableShading(Holo+4,1)
  234. holoColor(Holo+5,RandomColor)
  235. holoDisableShading(Holo+5,1)
  236.  
  237.  
  238. holoPos(Holo + 1, holoEntity(Holo):pos())
  239. holoPos(Holo + 2, holoEntity(Holo + 1):toWorld(vec(0, 0, -L1)))
  240. holoPos(Holo + 3, holoEntity(Holo):pos()-vec(0,0,10))
  241. holoPos(Holo + 4, holoEntity(Holo):pos()-vec(0,0,40))
  242. holoPos(Holo + 5, holoEntity(Holo):pos()-vec(0,0,20))
  243. }
  244.  
  245.  
  246. local Rotation = ang(0, 0, 0)
  247.  
  248. local Dir = Targ:pos() - holoEntity(Holo):pos()
  249. local AxisA = E:toLocalAxis(Dir):rotate(Rotation)
  250. local AxisB = holoEntity(Holo):toLocalAxis(Dir)
  251. local LegCount = min(Dir:length(), L1 + L2)
  252.  
  253. local Hip_p = atan(-AxisB[3], AxisB[1]) + acos((LegCount^2 + L1^2 - L2^2) / (2 * L1 * LegCount)) - 90
  254. local Knee = acos((L1^2 + L2^2 - LegCount^2) / (2*L1*L2))
  255.  
  256. holoAng(Holo, This:toWorld(ang(0, atan(AxisA[2], AxisA[1]) + 180, 0) - Rotation))
  257. holoAng(Holo + 1, holoEntity(Holo):toWorld(ang(Hip_p, 0, 0)))
  258. holoAng(Holo + 2, holoEntity(Holo + 1):toWorld(ang(Knee, 0, 0)))
  259. }
  260.  
  261. Systime = Rate / LegCount
  262.  
  263. rangerPersist(1)
  264. Const = E:getConstraints()
  265. Const:pushEntity(Pod)
  266. rangerFilter(Const)
  267. rangerFilter(players())
  268.  
  269. interval(Interval)
  270.  
  271.  
  272. function walking(){
  273.  
  274. Vel = E:velL():setZ(E:velL():z() / 10)
  275. Rot = E:angVelVector()
  276.  
  277. Driver = Pod:driver()
  278. W = Driver:keyForward()
  279. S = Driver:keyBack()
  280. A = Driver:keyLeft()
  281. D = Driver:keyRight()
  282. Space = Driver:keyJump()
  283. Shift = Pod:driver():keySprint()
  284. Alt = Driver:keyWalk()
  285. ALT = Driver:keyPressed("LALT")
  286.  
  287. Systime += (Rate * (1 + Shift / 2))+ (abs(Rot:z() / 600))
  288. Systime = Systime % (GC / 2)
  289.  
  290. Base_height = BaseHeight - (ALT*25)
  291.  
  292. for(I = 1, LegCount){
  293. local LG = ((I * 2) - 1) % GC ? ((I * 2) - 1) % GC : GC
  294. local HG = (I * 2) % GC ? (I * 2) % GC : GC
  295.  
  296. local High = StepSeq[I * 2 % GC, number]
  297. local Low = StepSeq[(I * 2 - 1) % GC, number]
  298.  
  299. local HH = High % (GC / 2)
  300. local LL = Low % (GC / 2)
  301.  
  302. local Range = inrange(Systime, clamp(Low, 0, Low), High) | inrange(Systime, LL, LL * 2 - HH) | inrange(Systime, HH * 2 - LL, HH)
  303.  
  304. local Sin = sin((I / LegCount) * 360 + (180 / LegCount + 90)) / 2
  305. local Cos = cos((I / LegCount) * 360 + (180 / LegCount + 90)) / 2
  306.  
  307. local HoverRan = rangerOffset(1000,E:toWorld(vec(0,0,0)),E:up()*-1)
  308.  
  309. E:iK(I, Length1, Length2, Legs[I, entity], 0.5)
  310.  
  311.  
  312. Ranger[I, ranger] = rangerOffset(RangeDist, E:toWorld(Pos[I, vector] + vec(0, 0, Ranger_z_offset) + clamp((Vel:setZ(0) / Compensate), -vec(Pos_comp), vec(Pos_comp))), vec(Cos, Sin, -1):rotate(E:toWorld(ang(0, 0, 0))))
  313.  
  314. if(Ranger[I, ranger]:distance() >= Leg_ground_hit_length)
  315. {
  316. Ranger[I, ranger] = rangerOffset(RangeDist, E:toWorld(Pos[I, vector] * (10 / 2) + vec(0, 0, Ranger_z_offset)), vec(-Cos, -Sin, -1):rotate(E:toWorld(ang(0, 0, 0))))
  317. }
  318.  
  319.  
  320.  
  321. if(!Legs[I, entity])
  322. {
  323. Legs[I, entity] = holoCreate(I, Ranger[I, ranger]:pos(), vec())
  324. holoParent(I, E)
  325. hint(Legs[I, entity]:toString(), 10)
  326. }
  327.  
  328. if(Ranger[I, ranger]:distance() <= Leg_ground_hit_length)
  329. {
  330. if(Clk[I, number] != Range)
  331. {
  332. Clk[I, number] = Range
  333. if(Range)
  334. {
  335. Step[I, vector] = Ranger[I, ranger]:position()
  336. Dist[I, number] = abs(holoEntity(I):pos():distance(Ranger[I, ranger]:position()))
  337. if(Ranger[I, ranger]:entity())
  338. {
  339. holoParent(I, Ranger[I, ranger]:entity())
  340. } else {
  341. holoUnparent(I)
  342. }
  343. } else {
  344. if(Dist[I, number] > 10)
  345. {
  346. holoPos(I, Step[I, vector])
  347. holoEntity(I):soundPlay(100 + I, 0.368, "npc/stalker/stalker_footstep_left"+randint(1,2)+".wav") #npc/stalker/stalker_footstep_left"+randint(1,2)+".wav
  348. soundPitch(100 + I, 100)
  349. }
  350. Hitnormal[I, vector] = Ranger[I, ranger]:hitNormal():rotate(ang(0, -E:angles():yaw() + 90, 0))
  351. }
  352. }
  353.  
  354. if(Clk[I, number] & Dist[I, number] > 10)
  355. {
  356. local Di = clamp(Dist[I, number] * Up_mul, 0, Up_clamp) #Get step distance
  357. local Dur = StepSeq[HG, number] - StepSeq[LG, number] #Get duration of step
  358. local Calc = 1 / Dur #Convert to dividend of 1 (for time)
  359. local Seq = Systime % Dur #Find remainder (for step duration). Multiplied by Calc to ensure 0 to 1 sequencing.
  360. local Mix = mix(mix(Step[I, vector], holoEntity(I):pos() + E:up() * Di, Seq), mix(holoEntity(I):pos() + E:up() * Di, holoEntity(I):pos(), Seq), Seq)
  361.  
  362. holoPos(I, Mix)
  363. }
  364. } else {
  365. holoPos(I, Ranger[I, ranger]:position())
  366. Step[I, vector] = Ranger[I, ranger]:position()
  367. }
  368.  
  369. Height[I, number] = Ranger[I, ranger]:distance()
  370. }
  371.  
  372. LR = FB = 0
  373. Angles = E:angles()
  374. A1 = vec()
  375.  
  376. for(I = 1, Step:count())
  377. {
  378. A1 += holoEntity(I):pos()
  379.  
  380. local Cos = cos((I / LegCount) * 360 + (180 / LegCount + 90))
  381. local Sin = sin((I / LegCount) * 360 + (180 / LegCount + 90))
  382. LR += Height[I, number] * Cos
  383. FB += Height[I, number] * Sin
  384. }
  385. A1 /= LegCount
  386.  
  387.  
  388. Ang = clamp(vec(-FB, LR, 0), -100, 100)
  389.  
  390.  
  391. local Ground = (Height:min() <= Leg_ground_hit_length)
  392.  
  393. local H = (((A1 + (E:up() * Base_height) - E:pos()) * !Space * Ground) - vec(0, 0, 20 * !Ground))
  394. local Res = (E:vel() * vec(0.8) * !Space * Ground * E:mass())
  395.  
  396. local Move = ((-E:forward() * (W - S)) * (30 * (1 + Shift)) * Ground * E:mass() * 4)
  397. local Jump = E:up() * Space * 300 * Ground * E:mass()
  398.  
  399. local Turn = vec(0, 0, ((A - D))) * 600 * Ground * E:inertia() * 2
  400.  
  401. E:applyForce((H * E:mass() * vec(2, 2, 4)) - Res - Move + Jump)
  402. E:applyTorque((Ang * E:inertia() * (100 / (2 * 1.5))) - (E:angVelVector() * E:inertia() * (20 + (5))) + Turn * (2))
  403. }
  404.  
  405.  
  406. function runE2(){
  407.  
  408. walking()
  409. setupPod(E:toWorld(vec(-12,0,24)),E:toWorld(ang(0,-90,0)),E)
  410.  
  411. }
  412.  
  413. }
  414.  
  415. if(last()){ Pod:propDelete() }
  416.  
  417.  
  418. if(opcounter()<(softQuota()) & perf()){
  419. runE2()
  420. }
  421. #—————————————-
  422. #—————————————-
  423. #—————————————-
  424. #End of Spider Mech
  425. #—————————————-
  426. #Start of Radar
  427. —————————————-
  428. #—————————————-
  429. #—————————————-
  430. #@name Player Only Radar Automation
  431. #@inputs Parent:entity TargeterSeat:entity EGP:wirelink CamHeading:angle Find
  432. #@persist TargetLoop TargetCurrent:entity TargetAngleDifference
  433. #@outputs Targets:array Target:entity Heading:angle Position:vector
  434.  
  435. if (first() | dupefinished()){
  436. rangerPersist(1)
  437. rangerFilter(Parent)
  438. rangerFilter(Parent:getConstraints())
  439.  
  440. function reloadTargets(){
  441. findClearWhiteList()
  442. findClearBlackList()
  443. findExcludeEntity(Parent)
  444. findExcludeEntities(Parent:getConstraints())
  445. findExcludePlayer(TargeterSeat:driver())
  446. findExcludeEntity(entity())
  447.  
  448. findByClass("player")
  449. local Players = findToArray()
  450.  
  451. #findByClass("acf_engine")
  452. #local Engines = findToArray()
  453.  
  454. #findByClass("gmod_wire_expression2")
  455. #local Chips = findToArray()
  456.  
  457. #findByClass("npc_*")
  458. #local NPCs = findToArray()
  459.  
  460. #findByClass("wac_*")
  461. #local NPC1s = findToArray()
  462.  
  463. #findByClass("gmod_safespace")
  464. #local NPC2s = findToArray()
  465.  
  466. #findByClass("prop_vehicle_jeep_old")
  467. #local NPC3s = findToArray()
  468.  
  469. #findByClass("prop_vehicle_airboat")
  470. #local NPC4s = findToArray()
  471.  
  472. #findByClass("prop_vehicle_jeep")
  473. #local NPC5s = findToArray()
  474.  
  475. Targets = Players#:add(Engines):add(NPCs):add(NPC1s):add(NPC2s):add(Chips):add(NPC3s):add(NPC4s):add(NPC5s)
  476. timer("reloadTargets", 5000)
  477. }
  478.  
  479. function stopFind(){
  480. Target = TargetCurrent
  481. TargetCurrent = noentity()
  482. TargetAngleDifference = 0
  483. TargetLoop = 0
  484. soundStop(1)
  485. TargeterSeat:soundPlay(2, 0, "acf_extra/airfx/hominglockaquired1.wav")
  486. }
  487.  
  488. function findTarget(){
  489. local Driver = TargeterSeat:driver()
  490. local DriverAngles = ->CamHeading ? CamHeading : Driver:eyeAngles()
  491. if (TargetLoop < Targets:count()){
  492. TargetLoop = TargetLoop + 1
  493. local Entity = Targets[TargetLoop, entity]
  494. local AngleHeading = -heading(Driver:pos(), ang(), Entity:pos())
  495. local AngleDelta = angnorm(AngleHeading - DriverAngles)
  496. local AngleDifference = abs(AngleDelta:pitch()) + abs(AngleDelta:yaw()) + abs(AngleDelta:roll())
  497. if (!TargetCurrent:isValid() | AngleDifference < TargetAngleDifference){
  498. TargetCurrent = Entity
  499. TargetAngleDifference = AngleDifference
  500. }
  501. timer("findTarget", 200)
  502. }else{
  503. stopFind()
  504. }
  505. }
  506.  
  507. function startFind(){
  508. TargetLoop = 0
  509. stoptimer("findTarget")
  510. findTarget()
  511. TargeterSeat:soundPlay(1, 0, "acf_extra/airfx/laser_track.wav")
  512. soundStop(2)
  513. }
  514.  
  515. function update(){
  516. if (EGP){
  517. EGP:egpClear()
  518. local ForwardRanger = rangerOffset(16000, Parent:pos(), Parent:forward())
  519. EGP:egp3DTracker(1, ForwardRanger:pos())
  520. #EGP:egpLine(2, vec2(0, -10), vec2(0, 10))
  521. #EGP:egpLine(3, vec2(-10, 0), vec2(10, 0))
  522. EGP:egpColor(2, vec(255, 0, 0))
  523. EGP:egpColor(3, vec(255, 0, 0))
  524. EGP:egpParent(2, 1)
  525. EGP:egpParent(3, 1)
  526.  
  527. local Count = 3
  528. foreach (I, Entity:entity = Targets){
  529. Count = Count + 1
  530. local Tracker = Count
  531. EGP:egp3DTracker(Tracker, vec())
  532. EGP:egpParent(Tracker, Entity)
  533.  
  534. Count = Count + 1
  535. EGP:egpTriangleOutline(Count, vec2(-10, 10), vec2(0, -10), vec2(10, 10))
  536. if (Entity == Target){
  537. EGP:egpColor(Count, vec(255, 0, 0))
  538. }else{
  539. EGP:egpColor(Count, vec(0, 255, 0))
  540. }
  541. EGP:egpParent(Count, Tracker)
  542.  
  543. Count = Count + 1
  544. local Type = Entity:type()
  545. if (Type == "player"){
  546. EGP:egpText(Count, Entity:name() + " - " + Entity:health() + "%", vec2(10, 15))
  547. EGP:egpColor(Count, teamColor(Entity:team()))
  548. # }elseif (Type == "acf_engine"){
  549. # EGP:egpText(Count, "Engine", vec2(10, 15))
  550. # }elseif (Type == "gmod_wire_expression2"){
  551. # EGP:egpText(Count, "E2", vec2(10, 15))
  552. # }elseif (Type:sub(1, 4) == "npc_"){
  553. # EGP:egpText(Count, Entity:name() + " - " + Entity:health() + "%", vec2(10, 15))
  554. # EGP:egpText(Count, "NPC", vec2(10, 15))
  555. # }elseif (Type:sub(1, 4) == "wac_"){
  556. # EGP:egpText(Count, "WAC", vec2(10, 15))
  557. # }elseif (Type == "gmod_safespace"){
  558. # EGP:egpText(Count, "Safe Space", vec2(10, 15))
  559. # }elseif (Type:sub(1, 4) == "prop_vehicle_jeep_old"){
  560. # EGP:egpText(Count, "Jeep", vec2(10, 15))
  561. # }elseif (Type:sub(1, 4) == "prop_vehicle_airboat"){
  562. # EGP:egpText(Count, "Airboat", vec2(10, 15))
  563. #}elseif (Type:sub(1, 4) == "prop_vehicle_jeep"){
  564. # EGP:egpText(Count, "Train", vec2(10, 15))
  565. }
  566.  
  567. if (Entity == Target){
  568. EGP:egpColor(Count, vec(255, 0, 0))
  569. }
  570. EGP:egpParent(Count, Tracker)
  571. }
  572. }
  573. if (Target:isValid()){
  574. Position = Target:massCenter()
  575. if (Target:isPlayer()){
  576. Position = Target:pos() + vec(0, 0, 32)
  577. }
  578. Heading = -heading(Parent:pos(), ang(), Position)
  579. }
  580. timer("update", 250)
  581. }
  582.  
  583. timer("reloadTargets", 10)
  584. timer("update", 500)
  585. }else{
  586. local ClkName = clkName()
  587. if (ClkName:length() > 0){
  588. ClkName()
  589. }elseif (~Find & Find){
  590. startFind()
  591. }
  592. }
  593. ################
  594. #EGP Auto Connect #
  595. ################
  596. #
  597. if(first() | duped())
  598. {
  599. EGP:egpHudToggle()
  600. reset()
  601. }
  602. #
  603. ################
  604. # End of E2. #
  605. ################
  606. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement