timer.Create("infection_tick", 15, 0, function()
for _, client in ipairs(player.GetAll()) do
-- client:StopSound("vj_player/heartbeat.wav");
local char = client:getChar()
local ent = ents.Create(zombieTable[math.random(1,12)])
if (client:Alive() and char) then
if char:getData( "infection" ) == true then
if client:Health() > 1 then
client:emote("infectionbloodvomit")
client:TakeDamage(1)
client:SetWalkSpeed(client:GetWalkSpeed() - 10)
client:SetRunSpeed(client:GetRunSpeed() - 30)
-- client:EmitSound("vj_player/heartbeat.wav")
end
if (client:GetWalkSpeed() <= 0 and client:GetRunSpeed() <= 0) then
-- client:emote("duck")
client:ConCommand("+duck")
end
if client:Health() == 1 then
client:TakeDamage(1)
ent:SetPos(client:GetPos())
ent:Spawn()
client:Spawn()
char:ban()
end
local effectdata = EffectData()
local pos, ang = client:GetBonePosition(client:LookupBone("ValveBiped.Bip01_Head1"))
effectdata:SetStart(pos)
effectdata:SetOrigin(pos)
effectdata:SetAttachment(client:LookupBone("ValveBiped.Bip01_Head1"))
effectdata:SetEntity(client)
effectdata:SetMagnitude( 1 )
effectdata:SetRadius( 1 )
util.Effect( "BloodImpact", effectdata, true, true )
util.Decal( "blood", client:GetPos() + Vector(math.random(1,30),-math.random(1,30),0), client:GetPos() - Vector(math.random(1,10),math.random(1,10),50))
util.Decal( "blood", client:GetPos() + Vector(-math.random(1,30),math.random(1,25),0), client:GetPos() - Vector(math.random(15,25),math.random(15,25),50))
util.Decal( "blood", client:GetPos() + Vector(math.random(1,35),-math.random(1,35),0), client:GetPos() - Vector(math.random(25,35),math.random(25,35),50))
util.Decal( "blood", client:GetPos() + Vector(-math.random(1,35),math.random(1,35),0), client:GetPos() - Vector(math.random(25,35),math.random(25,35),50))
util.Decal( "blood", client:GetPos() + Vector(math.random(1,30),math.random(1,30),0), client:GetPos() - Vector(math.random(1,10),math.random(1,10),50))
break
end
end
end
end)