THX for help
Forum
CS2D Scripts Zombie HPZombie HP
9 replies 1
THX for help
after you create them you should run this script:
1
2
3
4
5
2
3
4
5
for _,npcid in pairs(object(0,"table")) do 	if object(npcid,"health")==150 and object(npcid,"type")==30 then 		parse("damageobject "..npcid.." -1850 0") 	end end
if you always create them you should add a ms100 hook
i think a zombie has 150 hp, for other npc you must get there hp first. or you can change this:"if object(npcid,"health")==150 and" to "if object(npcid,"health")~=2000 and"
a zombie played by a player has max 250 hp, that can be changed with the hook spawn.
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
addhook('spawn','_spawn') function _spawn(id) if player(id,"team")==1 then parse('setmaxhealth '..id..' 250') parse('sethealth '..id..' 250') else parse('setmaxhealth '..id..' 100') parse('sethealth '..id..' 100') end
these two scripts could work:
Yates - ExtraHP Lua
More HP v2
You made spawn Ct whit 2000 hp ,
iii: Your lua script has errors. First of all, you did not put a addhook, which leads into a error because it wasnt functioned. Next, you forgot to put on tabs (It's what causes your lua's to get erros).
Heres the fully fixed script:
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
addhook("spawn","_spawn") function _spawn(id) 	if player(id,"team")==1 then 	parse('setmaxhealth '..id..' 250') 	parse('sethealth '..id..' 250') else 	if player(id,"team")==2 then 	parse('setmaxhealth '..id..' 100') 		parse('sethealth '..id..' 100') 		end 	end	 end
Like iii said, you need to look in the file archive for extra hp scripts
D-D3ADxPro has written
CaneCorso: Actually, you are wrong. Zombies are actually team 1(Terrorists). Every zombie script, they use team 1. Every human is on team 2.
iii: Your lua script has errors. First of all, you did not put a addhook, which leads into a error because it wasnt functioned. Next, you forgot to put on tabs (It's what causes your lua's to get erros).
Heres the fully fixed script:
Like iii said, you need to look in the file archive for extra hp scripts
iii: Your lua script has errors. First of all, you did not put a addhook, which leads into a error because it wasnt functioned. Next, you forgot to put on tabs (It's what causes your lua's to get erros).
Heres the fully fixed script:
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
addhook("spawn","_spawn") function _spawn(id) 	if player(id,"team")==1 then 	parse('setmaxhealth '..id..' 250') 	parse('sethealth '..id..' 250') else 	if player(id,"team")==2 then 	parse('setmaxhealth '..id..' 100') 		parse('sethealth '..id..' 100') 		end 	end	 end
Like iii said, you need to look in the file archive for extra hp scripts
You right , but he puted the hook xD, he need use tab
1