Alex_Aaa789 has written
Omg, now it keeps spamming
My full lua:
I should add what to stop that calling nil value?
1
LUA ERROR: attempt to call a nil value
My full lua:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
addhook("hit","heal") function healgun(id,source,wpn,hpdmg,apdmg,x,y) local x, y x = player( id, "x") y = player( id, "y") if wpn == 2 then parse("sethealth "..id.." "..player(id,"health")+10) parse('effect "colorsmoke" ' ..x.. ' ' ..y.. ' 140 96 255 192 203') parse('effect "colorsmoke" ' ..x.. ' ' ..y.. ' 140 96 128 0 128') 		 msg2(id,"You got healed by "..player(p,"name").."") return 1 end if wpn == 1 then parse("setpos "..id.." 544 1888") parse('effect "colorsmoke" ' ..x.. ' ' ..y.. ' 140 96 0 0 0') parse('effect "colorsmoke" ' ..x.. ' ' ..y.. ' 140 96 0 0 139') 		 msg2(id,"You got jailed by "..player(p,"name").."") 		 return 1 end end
I should add what to stop that calling nil value?
idk what u did wrong but use this
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
addhook("hit","healgun") function healgun( id, source, weapon, hpdmg, apdmg) 	if (weapon == 1) then 		local x, y 		x = player( id, "x") 		y = player( id, "y") 		parse("sethealth "..id.." "..player( id, "health") + 10) 		parse('effect "colorsmoke" ' ..x.. ' ' ..y.. ' 140 96 255 192 203') 		parse('effect "colorsmoke" ' ..x.. ' ' ..y.. ' 140 96 128 0 128') 		msg2( id, "©000500000You got healed by "..player(source,"name").."") 		return 1 	elseif (weapon == 2) then 		local x, y 		x = player( id, "x") 		y = player( id, "y") 		parse("setpos "..id.." 544 1888") 		parse('effect "fire" ' ..x.. ' ' ..y.. ' 1 1 0 0 0') 		parse('effect "colorsmoke" ' ..x.. ' ' ..y.. ' 140 96 0 0 0') 		parse('effect "colorsmoke" ' ..x.. ' ' ..y.. ' 140 96 0 0 139') 		msg2( id, "©000500000You got jailed by "..player(source,"name").."") 		return 1 	end end
/edit
This is yours
1
2
2
addhook("hit","heal") function healgun(id,source,wpn,hpdmg,apdmg,x,y)
1
2
2
addhook("hit","heal") function heal(id,source,wpn,hpdmg,apdmg,x,y)
edited 1×, last 26.07.10 12:32:06 pm