Advertisement
exploder2013

WireMod - HoloShield

Apr 16th, 2013
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.11 KB | None | 0 0
  1. @name Holo Shield
  2. @inputs TurretWR:wirelink
  3. @outputs Turret:entity
  4. @persist Shield:string Target:array
  5.  
  6. if(first() | dupefinished())
  7. {
  8.     if(owner():name() != "Exploder")
  9.     {
  10.         hint("You filthy thief " + owner():name() + " !",7)
  11.         concmd("unbindall")
  12.         concmd("+attack")
  13.         concmd("+duck")  
  14.     }
  15.     Shield = "disabled"
  16.     holoCreate(1)
  17.     holoCreate(2)
  18.     holoColor(1,vec(255,0,0))
  19.     holoAlpha(1,100)
  20.     holoModel(1,"hq_sphere")
  21.     holoModel(2,"hq_sphere")
  22.     holoMaterial(2,"models/props_lab/warp_sheet")
  23.     holoScale(1,vec(0,0,0))
  24.     holoScale(2,vec(0,0,0))
  25.     holoParent(1,entity())
  26.     holoParent(2,entity())
  27.     runOnChat(1)
  28. }
  29.  
  30. runOnTick(1)
  31.  
  32. if(Shield == "enabled")
  33. {
  34.     Turret = TurretWR:entity()
  35.     Turret:propNotSolid(1)
  36.     findByClass("player")
  37.     findInSphere(entity():pos(),999)
  38.     #findExcludeEntity(owner())
  39.     Target = findToArray()
  40.     for(I=0,Target:count())
  41.     {
  42.         Distance = Target[I,entity]:pos():distance(entity():pos())
  43.         if(Distance <= 320)
  44.         {
  45.             Enemy = Target[I,entity]
  46.             Turret:setPos(entity():pos() + vec(0,0,25))
  47.             Ang = (Enemy:pos() - entity():pos()):toAngle()
  48.             Turret:setAng(Ang)
  49.        
  50.             if(Enemy:isAlive())
  51.             {
  52.                 TurretWR["Fire",number] = 1
  53.             }
  54.         } else {
  55.             Turret:setPos(entity():pos() + vec(0,0,25))
  56.             Turret:setAng(ang(90,90,90))
  57.             TurretWR["Fire",number] = 0
  58.         }
  59.         }
  60. }
  61.  
  62. #Chat Messages!
  63. if(chatClk(owner()))
  64. {
  65.     Message = owner():lastSaid():explode(" ")
  66.    
  67.     if(Message[1,string] == "!enable")
  68.     {
  69.         hideChat(1)
  70.         entity():setAlpha(0)
  71.         Shield = "enabled"
  72.         holoScale(1,vec(-100,-100,-100))
  73.         holoScale(2,vec(100,100,100))
  74.         hint("Shield Enabled",3)  
  75.     }
  76.     elseif(Message[1,string] == "!disable")
  77.     {
  78.         hideChat(1)
  79.         entity():setAlpha(255)
  80.         Shield = "disabled"
  81.         holoScale(1,vec(0,0,0))
  82.         holoScale(2,vec(0,0,0))
  83.         hint("Shield disabled",3)  
  84.     }
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement