Jump to content

Health bar


-.Paradox.-

Recommended Posts

Posted (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 by Guest

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

Yes

local phealth = math.floor (getElementHealth ( getLocalPlayer() ))

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

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) 

Posted

Thanks working but there is a error in debug i will send you a pic in skype

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

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