Forum

> > CS2D > Scripts > NPC health
Forums overviewCS2D overview Scripts overviewLog in to reply

English NPC health

4 replies
To the start Previous 1 Next To the start

old NPC health

thesk5tera
User Off Offline

Quote
i need script
when i start play in map this map has 1 NPC health 1000
i want to see health npc like Hud

old :

Junior3534
User Off Offline

Quote
Omg... Nice idea,but i thing nobody maked it for now...

old Re: NPC health

Rainoth
Moderator Off Offline

Quote
Can you stop asking people for scripts and start learning to script them yourself ?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
tbl = {}

addhook("objectdamage","ihi")
function ihi(id,dmg,pl)
	tbl[id]={object(id,"health")}
end

addhook("second","ih")
function ih()
     for _,id in ipairs(player(0,"table")) do
		  parse('hudtxt2 '..id..' 0 "Targets health: '..tbl[id][1]..'" 99 135 0')
     end
end

addhook("join","hih")
function hih(id)
	tbl[id]=0
end

I won't help you anymore (I mean I won't write whole thing anymore, you'll have to do it yourself and if you encounter problems I'll help) and I advise others to do the same.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview