KingSCR Posted February 19, 2019 Posted February 19, 2019 (edited) Hi, I'm in need of help. I'm trying to show the player's life on the screen, however getElementhealth returns me a number like this "96.657466574" Can I convert it to integer? type: Life: 96 Sorry for my english, I'm using the translator. local Vida = getElementHealth ( localPlayer ) or 0 dxDrawText("Vida: "..Vida, x*932, y*62, x*1072, y*87, tocolor(255, 255, 255, 255), x*1.00, "default", "center", "center", false, false, false, false, false) Edited February 19, 2019 by KingSCR
KingSCR Posted February 19, 2019 Author Posted February 19, 2019 Resolved local Vida = math.floor( getElementHealth ( localPlayer ) or 0 )
Discord Moderators Pirulax Posted February 20, 2019 Discord Moderators Posted February 20, 2019 or you might as well just do a ("%i"):format(getElementHealth(localPlayer) or 0) thing
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