Forum

> > CS2D > Scripts > NPC - weapon dmg
Forums overviewCS2D overview Scripts overviewLog in to reply

English NPC - weapon dmg

2 replies
To the start Previous 1 Next To the start

old NPC - weapon dmg

pbeloto
User Off Offline

Quote
help me create the damage each weapon differently?


> examples
• laser = dmg npc 30% for shot
• m4a1 = dmg npc 3% for shot
• machet = dmg npc for 10% for shot
• FN9000 = dmg npc for 6% for shot

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
npc_force_1 = true

addhook("objectdamage","_objectdamage")
function _objectdamage(id_o,dmg,id_pl)
	if npc_force_1 then
		if id_o > 0 then
			if object(id_o,"type") == 30 then
				if object(id_o,"player") == 1 then     -- Zumbie --
					npc_force_1 = false
					parse("damageobject "..id_o.." 3 "..id_pl)
					npc_force_1 = true
				return 1
				end
			end
		end
	end
end

I tested
did not work: #

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
npc_force_1 = true

addhook("objectdamage","_objectdamage")
function _objectdamage(id_o,dmg,id_pl)
	if npc_force_1 then
		if id_o > 0 then
			if player(id,"weapontype") == 45 then
				if object(id_o,"type") == 30 then
					if object(id_o,"player") == 1 then     -- Zumbie --
						npc_force_1 = false
						parse("damageobject "..id_o.." 3 "..id_pl)
						npc_force_1 = true
					return 1
					end
				end
			end
		end
	end
end

plz help ??, thanks '-'

old Re: NPC - weapon dmg

Alistaire
User Off Offline

Quote
I made a seperate NPC handling system, that allows for such things. First of all I replace all NPC stats by a table that handles them separately, so you can e.g poison or burn NPC's without actually damaging their ingame health.

old Re: NPC - weapon dmg

pbeloto
User Off Offline

Quote
user Alistaire has written
I made a seperate NPC handling system, that allows for such things. First of all I replace all NPC stats by a table that handles them separately, so you can e.g poison or burn NPC's without actually damaging their ingame health.


I'm wondering what the npc get more health

but the damage of the weapons are different, laser takes self damage.

plz help me , or give you script?
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview