Jump to content

Headshot script


FastDriver

Recommended Posts

Posted

HEllo guys i got an problem with an headshot script could anyone help me and watch what is wrong?

addEvent "onPlayerHeadshot" 
  
addEventHandler("onPlayerDamage", getRootElement(), 
    function (attacker, weapon, bodypart, loss) 
        if not attacker then 
            return 
        end 
        if getElementType(attacker) ~= "player" then 
            return 
        end 
        if getPlayerTeam(attacker) then 
            if getTeamName(getPlayerTeam(attacker)) == "Anonymous" then 
    if getElementType(source) == "player" then 
        if bodypart == 9 then 
            local result = triggerEvent("onPlayerHeadshot", source, attacker, weapon, loss) 
            if result == true then 
                killPed(source, attacker, weapon, bodypart) 
            end 
        end 
    end 
) 

  • Moderators
Posted

why triggerEvent ?

why are you missing 2 end's?

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

 

  Useful functions  3x 

  Tutorials  4x 

 

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