Forum

> > CS2D > Scripts > Zombie HP
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Zombie HP

9 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Re: Zombie HP

iii
User Off Offline

Zitieren
Here is a script.
after you create them you should run this script:
1
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.

alt Re: Zombie HP

iii
User Off Offline

Zitieren
1
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

alt Re: Zombie HP

D-D3ADxPro
User Off Offline

Zitieren
user CaneCorso: Actually, you are wrong. Zombies are actually team 1(Terrorists). Every zombie script, they use team 1. Every human is on team 2.


user 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
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 user iii said, you need to look in the file archive for extra hp scripts

alt Re: Zombie HP

CaneCorso
User Off Offline

Zitieren
user D-D3ADxPro hat geschrieben
user CaneCorso: Actually, you are wrong. Zombies are actually team 1(Terrorists). Every zombie script, they use team 1. Every human is on team 2.


user 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
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 user 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
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht