Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.99 KB | None | 0 0
  1. function ent:PHinfect()
  2.     ent.phinfected = 1
  3.     timer.Create( ent:SteamID().."surccumb", 60, 0, PHsurccumb, ent)
  4.     timer.Create( ent:SteamID().."cough", 30, 0, PHcough, ent)
  5.     function ent:StartTouch(hitEnt)
  6.         if ent.phinfected == 1 do
  7.                 hitEnt:PHinfect()
  8.             end
  9.         end
  10.     end
  11. end
  12.  
  13. function ENT:Destruct()
  14.     local vPoint = self:GetPos()
  15.     local effectdata = EffectData()
  16.     local infectees = ents.FindInSphere(vPoint, 200)
  17.     WorldSound("ambient/materials/cupdrop.wav",vPoint,65,100)
  18.     effectdata:SetStart(vPoint)
  19.     effectdata:SetOrigin(vPoint)
  20.     effectdata:SetScale(1)
  21.     util.Effect("StriderBlood", effectdata)
  22.     for k, v in pairs(infectees) do
  23.         local ply = v
  24.         ply:infect()
  25.     end
  26. end
  27.  
  28. function PHsurccumb(ply)
  29.     if ply.phinfected == 1 do
  30.             ply.phinfected = 0
  31.             ply:kill()
  32.         end
  33.     end
  34. end
  35.  
  36. function PHcough(ply)
  37.     if ply.phinfected == 1 do
  38.             WorldSound("ambient/voices/cough1.wav",ply:GetPos(),70,100)
  39.             timer.Create( ply:SteamID().."cough", math.Rand(2,10), 0, PHcough, ply)
  40.         end
  41.     end
  42. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement