Dusty_Wings

Rainbow Bolts :3

Apr 10th, 2016
385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
E 2.07 KB | None | 0 0
  1. @name Rainbow Bolts
  2. @persist O:entity Inc TrailLength Bolts:array Count Rangers:array ParentEnt:entity
  3.  
  4. runOnTick(1)
  5. if(first()) {
  6.     ParentEnt = noentity()
  7.     TrailLength = 80
  8.     Rangers = array()
  9.     for(I = 1, TrailLength) {
  10.         holoCreate(I , entity():pos() + vec(I*10,0,50))
  11.         holoScale(I, vec(1,1,7))
  12.         holoModel(I, "hq_cone")
  13.         holoAng(I, ang(0,0,0))  
  14.     }  
  15.     Inc = 0
  16.     O = owner()
  17. }
  18. findByClass("crossbow_bolt")
  19. findSortByDistance(find():owner():pos())
  20. findExcludePlayerProps("*")
  21. findIncludePlayerProps("*")
  22. Bolts = findToArray()
  23. Count = Bolts:count()
  24. if(changed(find():pos()) & !ParentEnt:isValid()) {
  25.     if(Inc !=TrailLength ){
  26.         Inc += 1
  27.         holoPos(Inc, find():pos())
  28.         holoColor(Inc, hsv2rgb(360*curtime()/5%360,1,1))
  29.         holoAng(Inc, find():angles()+ang(90,0,0))
  30.         holoScale(Inc, vec(1,1,20))
  31.     }
  32.     if(changed(Inc) & Inc == TrailLength) {
  33.         Inc -= TrailLength  
  34.     }
  35. }
  36. for(I = 1, Bolts:count()) {
  37.     if(Bolts[I, entity]:isValid()) {
  38.         rangerFilter(owner())
  39.         rangerFilter(Bolts[I, entity])
  40.         Rangers[I, ranger] = rangerOffset(150,Bolts[I,entity]:pos(),Bolts[I,entity]:forward())  
  41.     }
  42.     if(changed(Rangers[I , ranger]:hit()) & Rangers[I, ranger]:hit()) {
  43.         ParentEnt = Rangers[I, ranger]:entity()
  44.         print(Rangers[I, ranger]:entity():model())
  45.         print("hit")
  46.     }  
  47. }
  48. if(changed(ParentEnt) & ParentEnt:isValid()) {
  49.     ParentEnt:setMaterial("models/debug/debugwhite")  
  50. }
  51. if(ParentEnt:isValid()) {
  52.     if(changed(ParentEnt:pos()) | changed(ParentEnt:angles())) {
  53.         Inc += 1
  54.         ParentEnt:setColor(hsv2rgb(360*curtime()/5%360,1,1))
  55.         holoPos(Inc, ParentEnt:pos())
  56.         holoColor(Inc, hsv2rgb(360*curtime()*3%360,1,1))
  57.         holoAng(Inc, ParentEnt:angles()+ang(0,0,0))
  58.         holoScale(Inc, vec(1,1,1))
  59.         holoMaterial(Inc, "models/debug/debugwhite")
  60.         holoModel(Inc, ParentEnt:model())
  61.         if(changed(Inc) & Inc == TrailLength) {
  62.             Inc -= TrailLength  
  63.         }
  64.     }  
  65. }
Add Comment
Please, Sign In to add comment