Jump to content

Katana Damage


Recommended Posts

Hello, can somebody see what's wrong here? It suppose to set the victim headless and die, but it wont work, no errors in debug script when i hit a ped or a player, thanks.

addEventHandler("onPlayerDamage",root, 
function(killer, weapon, bodypart) 
if (killer and getElementType(killer) == "player" and killer ~= source) then 
     if weapon == 8 then 
        setPedHeadless(killer, true) 
        killPed(source,killer,weapon) 
     end 
end 
end) 

Link to comment
  
addEventHandler("onPlayerDamage",root,function(attacker,weapon,part) 
    if attacker and getElementType(attacker) == "player" and attacker ~= source then 
        if weapon == 8 and part == 9 then 
            setPedHeadless(source,true) 
            killPed(source,attacker,weapon,part) 
        end 
    end 
end) 
  

Link to comment
Thanks it's working but i have to aim in the head, Is it possible to make it without aiming? I mean once i hit him with katana he die..
addEventHandler("onPlayerDamage",root,function(attacker,weapon,part) 
    if attacker and getElementType(attacker) == "player" and attacker ~= source then 
        if weapon == 8 then 
            setPedHeadless(source,true) 
            killPed(source,attacker,weapon,part) 
        end 
    end 
end) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...