Jump to content

Healt Progress


#Paper

Recommended Posts

addEventHandler("onClientRender",getRootElement(), 
function () 
if ( somebar ) then 
    local veh = getPedOccupiedVehicle(getLocalPlayer()) 
    if veh then 
    health = getElementHealth(veh)/100*10 
    guiProgressBarSetProgress(somebar, health) 
      end 
   end 
end) 

It should work.

Edited by Guest
Link to comment
addEventHandler("onClientRender",getRootElement(), 
function () 
if ( somebar ) then 
    local veh = getPedOccupiedVehicle(getLocalPlayer() 
    if veh then 
    health = math.floor(getElementHealth(veh)) 
    guiProgressBarSetProgress(somebar, health) 
      end 
   end 
end) 

It should work.

No, it doesn't work, and doesn't show any error...

P.S: You forgot a ')' to close getPedOccupiedVehicle, i added it :D

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