¿Quién debería tener la tecla presionada?
-- Client side
addEventHandler("onClientPlayerDamage", localPlayer,
function (attacker, weapon)
if ( getKeyState('p') and weapon == 8 ) then
triggerServerEvent( "killOnKatanaHit", resourceRoot, source, attacker, weapon)
end
end
)
-- Server side
addEvent("killOnKatanaHit", true)
addEventHandler("killOnKatanaHit", root,
function (player, attacker, weapon)
killPed(player, attacker, weapon)
end
)