Jump to content

Help in Health Cloumn


^Dev-PoinT^

Recommended Posts

Posted

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) 

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

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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) 

Business System viewtopic.php?f=108&t=35797

Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726

SQLite Tutorial viewtopic.php?f=148&t=38203

Posted

I've tested that, and it doesn't.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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