Forum

> > CS2D > Scripts > NPC - weapon dmg
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch NPC - weapon dmg

2 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt NPC - weapon dmg

pbeloto
User Off Offline

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

alt Re: NPC - weapon dmg

Alistaire
User Off Offline

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

alt Re: NPC - weapon dmg

pbeloto
User Off Offline

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