Forum

> > CS2D > Scripts > [SOLVED] Lifesteal fail
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch [SOLVED] Lifesteal fail

2 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt [SOLVED] Lifesteal fail

Ace Howl
User Off Offline

Zitieren
Hello.

Whenever I try to create a code that makes attacker will gain HP when they get a kill, it always heal towards the victim.

1
2
3
4
5
6
function codeKill(id,killer,victim)
	if lifesteal[id] > 0 then
		parse("sethealth "..victim.." "..(player(victim,"health")+lifesteal[id]))
		msg(player(victim,"name").." had his health restored.") -- this line acts like debug
	end
end

Regardless the position of 'victim' and 'killer', it always point towards the dead.
1× editiert, zuletzt 01.06.15 07:58:08

alt Re: [SOLVED] Lifesteal fail

Mora
User Off Offline

Zitieren
fux, i've pressed msg and failure send, there is code with msg:
1
2
3
4
5
6
7
lifesteal = 5 --5 is test, change it to your value

addhook("kill","killAt")
function killAt(killer,victim)
	parse("sethealth "..killer.." "..player(killer,"health")+lifesteal)
	msg(player(killer,"name").." has "..player(victim,"name").."'s health restored.")
end
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht