Forum

> > CS2D > Scripts > medic claw lua help still not working
Forums overviewCS2D overview Scripts overviewLog in to reply

English medic claw lua help still not working

5 replies
To the start Previous 1 Next To the start

old medic claw lua help still not working

robed
User Off Offline

Quote
can semoene help me how to make medic claw

i were tryin to add health when you hit enemy or friendly with a claw using lua

1.) IS THE ADHOOK SHOULD BE LIKE THIS??
1
addhook ("hit","mediclaw")

2.)is the function supposed to be like this?
1
function mediclaw(id,source)

3.) i dont know how to make that thingy
1
if item = 69 then?

4.) is this right? for this
1
2
parse ("health "..source.." "..player(source,"health")+5)
end


i know this is a easy script for pro script but can you help me making this script
edited 1×, last 27.05.11 07:38:00 pm

old Re: medic claw lua help still not working

kalis
User Off Offline

Quote
hey
1
2
3
4
5
6
addhook("hit","medicclaw_hit")
function medicclaw_hit(id,source,wpn,hpdmg)--ID is player get hit ,source is player hit---
if wpn == 78 then --- claw id 78
	parse("sethealth "..id.." "..player(id,"health")+5)---sethealth not USE "health" ,heal for player--
end
end
i think it right
√

old Re: medic claw lua help still not working

DannyDeth
User Off Offline

Quote
@heocon: You aren't entirely right, you need to add return 1 if the weapon is the claw, otherwise your script will still do the damage of the claw
1
2
3
4
5
6
7
addhook("hit","medicclaw_hit")
function medicclaw_hit(id,source,wpn)
	if wpn == 78 then --- claw id 78
		parse("sethealth "..id.." "..player(id,"health")+5)
		return 1
	end
end

old Re: medic claw lua help still not working

Starkkz
Moderator Off Offline

Quote
Also you could give the full parameters, that can be useful for someone who doesn't know much about the lua hooks.

Quote
medicclaw_hit(id,source,wpn,hpdmg,apdmg)


apdmg = damage caused in the armor
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview