Jump to content

Help in Health Cloumn


^Dev-PoinT^

Recommended Posts

Hi all i made this

but when Player loss some healths it show like this 80.9848348

90.04009493

20.00040

i want like BaseMode

100

80

60

40

....

function myHealth() 
    exports.scoreboard:scoreboardAddColumn ( "Health" ) 
    local playerHealth = getElementHealth ( getLocalPlayer() ) 
    setElementData ( getLocalPlayer ( ), "Health", playerHealth) 
end 
addEventHandler ( "onClientResourceStart", resourceRoot, myHealth) 

Link to comment
function myHealth() 
    exports.scoreboard:scoreboardAddColumn ( "Health" ) 
    local playerHealth = getElementHealth ( getLocalPlayer() ) 
    setElementData ( getLocalPlayer ( ), "Health", math.floor(playerHealth)) 
end 
addEventHandler ( "onClientResourceStart", resourceRoot, myHealth) 

Link to comment

Don't you look at the script?

It's clearly not updating.

function myHealth() 
    exports.scoreboard:scoreboardAddColumn ( "Health" ) 
    local playerHealth = getElementHealth ( localPlayer ) 
    setElementData ( localPlayer, "Health", math.floor(playerHealth)) 
    setTimer ( function ()     
         local playerHealth = getElementHealth ( getLocalPlayer() ) 
         setElementData ( localPlayer, "Health", math.floor(playerHealth)) 
   end, 3000 , 0 ) 
end 
addEventHandler ( "onClientResourceStart", resourceRoot, myHealth) 

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