-.Paradox.- Posted November 2, 2013 Share Posted November 2, 2013 (edited) Hello, i want to create a dxRectangle and show in it the player health here is my code i got a error in debugscript 3 WARNING: Hud/hud.lua:65: Bad argument @ 'dxDrawRectangle' [Expected bool at argument 6, got number '-16745728'] dxDrawRectangle(1107, 54, 211, 13, tocolor(0, 0, 0, 255), true) dxDrawRectangle(" "..phealth.." ",1108, 55, 209, 11, tocolor(255, 0, 0, 255), true) Edited November 2, 2013 by Guest Link to comment
pa3ck Posted November 2, 2013 Share Posted November 2, 2013 Is phealth defined in your script? Link to comment
-.Paradox.- Posted November 2, 2013 Author Share Posted November 2, 2013 Yes local phealth = math.floor (getElementHealth ( getLocalPlayer() )) Link to comment
Cadell Posted November 2, 2013 Share Posted November 2, 2013 I think there no need to use math for getting health just use getElementHealth (localPlayer) then it start work fine if tell me ill make u that Link to comment
codeluaeveryday Posted November 2, 2013 Share Posted November 2, 2013 I'm pretty sure this is all your wanted? local pHealth = getElementHealth(localPlayer) if pHealth > 100 then pHealth = pHealth / 2 end dxDrawRectangle(1107, 54, 211, 13, tocolor(0, 0, 0, 255), true) dxDrawRectangle(1108, 55, 209*(pHealth/100), 11, tocolor(255, 0, 0, 255), true) Link to comment
-.Paradox.- Posted November 2, 2013 Author Share Posted November 2, 2013 Thanks working but there is a error in debug i will send you a pic in skype 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