-.Paradox.- Posted April 14, 2014 Posted April 14, 2014 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 IIYAMA Posted April 14, 2014 Moderators Posted April 14, 2014 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 Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
cheez3d Posted April 14, 2014 Posted April 14, 2014 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)
-.Paradox.- Posted April 14, 2014 Author Posted April 14, 2014 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.
Alexs Posted April 14, 2014 Posted April 14, 2014 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now