i have problem with customkill. i want create random damage. but it only shows "Player died" and not "Idlers M4A1 Player". i know there more than 1 thread about this, but im not found the solution, i was read Lua Error - Custom kill but it still not work!
my code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
-- Random damage by Rian2_idih
addhook("hit","randomdmg")
function randomdmg(id,pl,weapon,hp,ap)
	hpdmg = math.random(hp,hp+20)
	hpnoarmor = math.random(hp,hp+40)
	apdmg = math.random(ap,ap+12)
	if (player(id,"health")+hpdmg)>0 then
		if player(id,"armor")>0 then
			parse("sethealth "..id.." "..(player(id,"health")-hpdmg))
			parse("setarmor "..id.." "..(player(id,"armor")-apdmg))
		else
			parse("sethealth "..id.." "..(player(id,"health")-hpnoarmor))
		end
	else
		parse('customkill '..pl..' "..itemtype(weapon,"name").." '..id)
	end
	return 1
end
This maybe help you! *ref link removed* Admin/Mod Kommentar
Didn't you read in the rules, 'No ref links'? Well, adfly is ref links. 1
2
3
parse ("customkill "..pl.." "..itemtype(weapon("name")).." "..id);
--or
parse ('customkill '..pl..' '..itemtype(weapon('name'))..' '..id);
You don't have to qoute the killweaponname. TimeQuesT hat geschrieben
1
2
3
parse ("customkill "..pl.." "..itemtype(weapon("name")).." "..id);
--or
parse ('customkill '..pl..' '..itemtype(weapon('name'))..' '..id);
You don't have to qoute the killweaponname.
u are good everything not work! it keep says "Player died"