Forum

> > CS2D > Scripts > cs2d npc HP
Forums overviewCS2D overview Scripts overviewLog in to reply

English cs2d npc HP

6 replies
To the start Previous 1 Next To the start

old cs2d npc HP

pbeloto
User Off Offline

Quote
Hii all , Plz help me give hp for npc .

Example,


addhook("second","_second")
function _second(id)
     parse ("spawnnpc "..type.." "..x.." "..y) -- no have hp npc '-'
end


spawn npc solied 1000 HP .

plz help '-'

sorry me inglish.

old Re: cs2d npc HP

MikuAuahDark
User Off Offline

Quote
you can't spawn NPC with custom health. But if you only gonna spawn NPC on that position(no more NPC gonna spawn twice at that position) you can use cs2d cmd damageobject to set NPC health

old Re: cs2d npc HP

pbeloto
User Off Offline

Quote
user MikuAuahDark has written
you can't spawn NPC with custom health. But if you only gonna spawn NPC on that position(no more NPC gonna spawn twice at that position) you can use cs2d cmd damageobject to set NPC health


1
2
3
4
5
6
7
8
addhook("damageobject","_damageobject")
function _damageobject(id,dmg,pl)
	if object(id,"type") == 30 then
		if object(id,"player") == 1 then
			..ZzZzZz
		end
	end
end

help me

old Re: cs2d npc HP

omg
User Off Offline

Quote
-.-

u obviously didnt get the point of what 0x4 was saying

old help me :(

pbeloto
User Off Offline

Quote
I did not understand until now, could make a command for me?


1
2
3
4
5
6
7
8
9
10
11
addhook("objectdamage","_objectdamage")
function _objectdamage(id_o,dmg,id_pl)
	if id_o > 0 then
		if object(id_o,"type") == 30 then
			if object(id_o,"player") == 1 then	
			parse("damageobject "..id_o.." 1 "..id_pl)
			return 1
			end
		end
	end
end

#Error : LUA ERROR: C stack overflow
edited 1×, last 11.10.13 04:26:39 am
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview