Making zombies walk slower
Giving zombies a random health amount
Making zombies appear randonly on the map
Zombies respawning after death
Any help would be greatly appreciated! Thank you!
Scripts
Lua Scripting Crash Course!
Lua Scripting Crash Course!
1

-- UNTESTED --
zm={}
-- <editable values> --
zm.speedmod=-15 -- Speedmod for zombies
zm.healthMin=80 -- Min and max extremes of health giver
zm.healthMax=120
zm.xPositions={1,2 ,3 ,4 ,5 } -- choices for x and y positions, 2 from the same column are picked randomly, example is 1 and 7
zm.yPositions={7,14,21,28,35} -- because of this, each table must have the same amount of entries
zm.defaultSpawnpoint={52,33} -- just put {x,y} of any walkable tile.
-- <end of editable values> --
addhook("spawn","zombieSpawn")
addhook("die","zombieDie")
function zombieSpawn(id)
local pos=math.random(1,#xPositions)
	if player(id,"team")==1 then
		parse("setpos "..id.." "..( math.random(1,pos) ).." "..( math.random(1,pos) ) ) -- Spawn at random spot
		parse("speedmod "..id.." "..zm.speedmod) -- Speed
		parse("sethealth "..id.." "..( math.random(zm.healthMin,zm.healthMax) ) ) -- Health
	end
end
function zombieDie(id)
	if player(id,"team")==1 then
		parse("spawnplayer "..id.." "..zm.defaultSpawnpoint[1].." "..zm.defaultSpawnpoint[2])
	end
end
<CS2D INSTALL ROOT>\sys\lua\and put the above in somthing like zombieMod.lua
mysteryguy202 has written
1
