Advertisement
Guest User

Gas Zone 1

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