Advertisement
Guest User

Gas Zone 2

a guest
Aug 21st, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1.  
  2. AddCSLuaFile( "cl_init.lua" )
  3. AddCSLuaFile( "shared.lua" )
  4. include('shared.lua')
  5.  
  6. ENT.DontDamageNpcs = {
  7. "npc_zombie"
  8. }
  9.  
  10. function ENT:Initialize()
  11. self.Entity:SetModel( "models/props_lab/jar01b.mdl" )
  12. self.Entity:SetMoveCollide(COLLISION_GROUP_PROJECTILE)
  13. self.Entity:SetCollisionGroup(COLLISION_GROUP_PROJECTILE)
  14. self.Entity:PhysicsInit( SOLID_VPHYSICS )
  15. self.Entity:SetMoveType( MOVETYPE_VPHYSICS )
  16. self.Entity:SetSolid( SOLID_VPHYSICS )
  17. self.Entity:GetPhysicsObject():SetMass(5)
  18. self.Entity:GetPhysicsObject():SetDragCoefficient( 0)
  19. self.Entity:DrawShadow(false)
  20.  
  21. local phys = self.Entity:GetPhysicsObject()
  22. if (phys:IsValid()) then
  23. phys:Wake()
  24. end
  25.  
  26. end
  27.  
  28. function ENT:SetEntityOwner(ent)
  29. self:SetOwner(ent)
  30. self.entOwner = ent
  31. end
  32.  
  33. function ENT:PhysicsCollide(data, physobj)
  34. return true
  35. end
  36.  
  37. function ENT:OnRemove()
  38.  
  39. end
  40.  
  41.  
  42. function ENT:Think()
  43. local entes = ents.GetAll()
  44. local d = DamageInfo()
  45. d:SetDamage( math.random(0.5, 1) )
  46. d:SetAttacker( self.Entity )
  47. d:SetDamageType( DMG_RADIATION )
  48. for k, v in pairs(entes) do
  49. if v:GetNWBool("HasGasmask", false) then
  50. if v:GetNWInt("FilterDuration") >= 0 then
  51. return
  52. else
  53. continue
  54. end
  55. end
  56.  
  57.  
  58. if v:GetPos().z >= self.Entity:GetPos().z-50 and !table.HasValue( self.DontDamageNpcs, v:GetClass() ) then
  59. if v:IsPlayer() or v:IsNPC() then
  60. v:TakeDamageInfo( d )
  61. end
  62. end
  63. end
  64. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement