Jump to content

Katana Damage


Recommended Posts

Posted

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) 

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

  • Moderators
Posted

setPedHeadless(killer, true) 
setPedHeadless(source, true) 

For the rest debug the code manually, because it has to work.

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted
  
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) 
  

Posted

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..

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted
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) 

Developer @ MYVAL

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...