^Dev-PoinT^ Posted November 25, 2011 Posted November 25, 2011 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)
Castillo Posted November 25, 2011 Posted November 25, 2011 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. Education is the most powerful weapon which you can use to change the world.
^Dev-PoinT^ Posted November 25, 2011 Author Posted November 25, 2011 no dont count the Health its always 100 even when i slap my self
JR10 Posted November 25, 2011 Posted November 25, 2011 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
^Dev-PoinT^ Posted November 25, 2011 Author Posted November 25, 2011 Now its works Thx Jr10 and SoldSnake
Castillo Posted November 25, 2011 Posted November 25, 2011 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
12p Posted November 25, 2011 Posted November 25, 2011 This is related to topic: When using setElementHealth, is onClientPlayerDamage triggered?
Castillo Posted November 25, 2011 Posted November 25, 2011 I've tested that, and it doesn't. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now