Forum

> > CS2D > Scripts > kill +20 hp
Forums overviewCS2D overview Scripts overviewLog in to reply

English kill +20 hp

3 replies
To the start Previous 1 Next To the start

old kill +20 hp

StrangeGuy
BANNED Off Offline

Quote
hello guys, i am new here & noob scripting

so i need script if player killed another player he will get +20 hp
please i need help to do it

thanks for reading

old Re: kill +20 hp

RIP-HereRestsPlookerbooy
BANNED Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
addhook("kill","_kill")
function _kill(killer,victim,weapon,x,y)

	if player(victim,"exists") and player(killer,"exists") then

		parse("sethealth " .. killer .. " " .. player(killer,"health")+20)

	end

end

user Yates: You mean like this? really?
edited 1×, last 16.01.17 11:10:15 am

old Re: kill +20 hp

Yates
Reviewer Off Offline

Quote
@user RIP-HereRestsPlookerbooy: Please, use, spaces, behind, commas, like, you, are, supposed, to.

This,looks,like,crap,and,is,wrong.

Edit: No, I mean like this:

1
2
3
4
5
6
addhook("kill", "_kill")
function _kill(killer, victim, weapon, x, y)
     if player(victim, "exists") and player(killer, "exists") then
          parse("sethealth " .. killer .. " " .. player(killer, "health")+20)
     end
end
edited 1×, last 16.01.17 11:39:03 am

old Re: kill +20 hp

Rainoth
Moderator Off Offline

Quote
1
2
3
4
addhook("kill","_kill")
function _kill(k)
	parse("sethealth "..k.." "..player(k,"health")+20)
end

You're welcome.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview