Forum

> > CS2D > General > Ammo,Medic kit lua script help !!
Forums overviewCS2D overviewGeneral overviewLog in to reply

English Ammo,Medic kit lua script help !!

4 replies
To the start Previous 1 Next To the start

old closed Ammo,Medic kit lua script help !!

Maniek
User Off Offline

Quote
Hi


I want create a script.
When I hit machet on my position spawn primary ammo
When I hit claw on my position spawn medickit

Quote
addhook("hit","cod4.health")
function cod4.health(id,source,wpn,hpdmg,apdmg)
if (wpn == 78) then
          parse("sethealth "..id.." "..player(id,"health")+5)
          return 1

end

addhook("hit","cod4.hit")
function cod4.hit(id)
if (wpn == 69) then
          parse("spawnitem 61 "..player(id,"tilex").." "..player(id,"tiley").."")
          parse("spawnitem 62 "..player(id,"tilex").." "..player(id,"tiley").."")
          return 1

end

end


what is wrong ??

old Re: Ammo,Medic kit lua script help !!

mafia_man
User Off Offline

Quote
Are you know this thread ??
Lua Scripts/Questions/Help

You only spam !
post in Lua Scripts/Questions/Help thread and don't create new threads because it's spam and you can get ban

old Re: Ammo,Medic kit lua script help !!

TimeQuesT
User Off Offline

Quote
there is no "end" for the function cod4.health.
just put it to he end of the function.
(yes that's spam pls wirte in the Lua Scripts/Questions/Help thread)
edit:you the console to debug!

old Re: Ammo,Medic kit lua script help !!

GINO
BANNED Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
addhook("hit","cod4.health") 
function cod4.health(id,source,wpn,hpdmg,apdmg) 
if (wpn == 78) then 
          parse("sethealth "..id.." "..player(id,"health")+5) 
          return 1 

end 

addhook("hit","cod4.hit") 
function cod4.hit(id) 
if (wpn == 69) then 
          parse("spawnitem 61 "..player(id,"tilex").." "..player(id,"tiley").."") 
          parse("spawnitem 62 "..player(id,"tilex").." "..player(id,"tiley").."") 
          return 1 

end 

end
plz remove the doble end like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
addhook("hit","cod4.health") 
function cod4.health(id,source,wpn,hpdmg,apdmg) 
if (wpn == 78) then 
          parse("sethealth "..id.." "..player(id,"health")+5) 
          return 1
end 

addhook("hit","cod4.hit") 
function cod4.hit(id) 
if (wpn == 69) then 
          parse("spawnitem 61 "..player(id,"tilex").." "..player(id,"tiley").."") 
          parse("spawnitem 62 "..player(id,"tilex").." "..player(id,"tiley").."") 
          return 1 
end

old Re: Ammo,Medic kit lua script help !!

ohaz
User Off Offline

Quote
No. The double end was right. But there was one missing
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
addhook("hit","cod4.health")
function cod4.health(id,source,wpn,hpdmg,apdmg)
	if (wpn == 78) then
	parse("sethealth "..id.." "..player(id,"health")+5)
	return 1

	end
[b]end[/b]

addhook("hit","cod4.hit")
function cod4.hit(id)
	if (wpn == 69) then
	parse("spawnitem 61 "..player(id,"tilex").." "..player(id,"tiley").."")
	parse("spawnitem 62 "..player(id,"tilex").." "..player(id,"tiley").."")
	return 1

	end

end
To the start Previous 1 Next To the start
Log in to replyGeneral overviewCS2D overviewForums overview