Advertisement
HyuruPAC3

sfera

May 24th, 2018
3,035
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
E 1.87 KB | None | 0 0
  1. @name Sfera
  2. @persist [E O]:entity White:array Size Distans
  3.  
  4. interval(100)
  5.  
  6. if(first()){
  7.    
  8.     #noDuplications()
  9.     E = entity()
  10.     O = owner()
  11.    
  12.  Size = 1 #Max 7
  13.  Distans = 5 #Max 10
  14.  
  15.     holoCreate(0,E:toWorld(vec(0)),vec(1)*Size,E:toWorld(ang()),vec(255,25,25),"icosphere3")
  16.     holoMaterial(0,"models/XQM/LightLinesRed_tool") holoAlpha(0,150)
  17.    
  18.     # Sphere
  19.     holoCreate(1,E:toWorld(vec(0)),vec(7)*Size,ang(),vec(25,250,25),"models/props_phx/construct/metal_dome360.mdl")
  20.     #holoCreate(1,E:toWorld(vec(0,0,0)),vec(7)*Size,ang(),vec(25,250,25),"models/props_phx/construct/glass/glass_angle360.mdl")
  21.     #holoCreate(2,E:toWorld(vec(0)),-vec(7)*Size,ang(),vec(25,25,25),"models/props_phx/construct/metal_dome360.mdl")
  22.     holoMaterial(1,"debug/debugdrawflat")
  23.     #holoMaterial(2,"debug/debugdrawflat")
  24.    
  25.     holoParent(0,E)
  26.     holoParent(1,E)
  27.     #holoParent(2,E)
  28.    
  29.     White:pushEntity(findPlayerByName("<hsv>Boop</hsv>"))
  30.    
  31. } else {
  32.  
  33.     findIncludeClass("player")
  34.     findIncludeClass("prop")
  35.    
  36.     if(findCanQuery()){
  37.        
  38.         findInSphere(E:pos(),330*Size)
  39.         F = findToArray()
  40.         local I = 0
  41.        
  42.         while( I < F:count() & perf() ){
  43.             I++
  44.             local Who = F:entity(I)
  45.            
  46.            
  47.            
  48.             local CanKill = 1
  49.             foreach(J, E:entity = White) {
  50.                 if(E:name() == Who:name()) {
  51.                     findExcludePlayerProps(E:name())
  52.                     CanKill = 0
  53.                     break
  54.                 }
  55.            }
  56.            
  57.         if(CanKill) {
  58.             if(Who:isPlayer()){
  59.                 Who:setVel( (Who:pos() - E:pos())*Distans )
  60.             }
  61.             elseif(Who:isPhysics()){
  62.                 Who:setVel( (Who:pos() - E:pos())*Distans )
  63.                 Who:remove(1)
  64.             }
  65.         }
  66.     }
  67. }
  68.  
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement