Jump to content

How to get ped's health?


King12

Recommended Posts

Hello, I'm working on a basic script to improve my scripting skills.

I wanted to get the peds health but I couldn't. Here is my code :

  
ped1 = createPed(120, -2407.6513671875, -592.85119628906, 132.6484375) 
function pedHealth () 
    local peds = getElementHealth ( ped1() ) 
    if peds == 90 then 
    setElementHealth ( ped1, 100 ) 
    outputChatBox ( "The ped have been healed to 100", 255, 0, 0, true) 
    end 
end 
addEventHandler("onClientPedDamage", ped1, pedHealth) 

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