1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
infectedpl = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
--Hooks
addhook("join","infzero")
addhook("second","isinf")
addhook("hit","infect")
--Functions
function infzero(id)
infectedpl[id] = 0
end
function infect(id,source,weapon,hpdmg,apdmg)
if (player(source,"team") == 1) then
if (weapon == 78) then
local rand = math.random(1,5)
if (rand == 3) then
infectedpl[id] = 1
end
end
end
end
function isinf()
for i=1,32 do
if(player(i,"exists")) then
if(infectedpl[i]==1 and player(i,"team")==2) then
if(player(i,"health")<=10) then --If player is about to be turned into zombie
local x = player(i,"x")
local y = player(i,"y")
parse("maket "..i)
parse("spawnplayer "..i.." "..x.." "..y)
else
parse("sethealth "..i.." "..(player(i,"health")-10))
end
end
end
end
end