^Dev-PoinT^ Posted November 25, 2011 Share 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) Link to comment
Castillo Posted November 25, 2011 Share 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) Link to comment
^Dev-PoinT^ Posted November 25, 2011 Author Share Posted November 25, 2011 no dont count the Health its always 100 even when i slap my self Link to comment
JR10 Posted November 25, 2011 Share 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) Link to comment
^Dev-PoinT^ Posted November 25, 2011 Author Share Posted November 25, 2011 Now its works Thx Jr10 and SoldSnake Link to comment
12p Posted November 25, 2011 Share Posted November 25, 2011 This is related to topic: When using setElementHealth, is onClientPlayerDamage triggered? Link to comment
Castillo Posted November 25, 2011 Share Posted November 25, 2011 I've tested that, and it doesn't. Link to comment
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