Jump to content

Healthbar teamcolor


BorderLine

Recommended Posts

Hi forum

well i was trying to make a healthbar with teamcolor

i try this but the healthbar is black

  
                    local health 
            local r, g, b = getTeamColor( player ) 
                    health = getElementHealth ( player ) 
                    health = math.max(health, 0)/100 
    dxDrawImageSection(drawX, drawY, width, height, math.floor(256 - 256 * (health)), 0, 256, 16, "images/h1.png", 0, 0, 0, tocolor(r, g, b, 200)) 
  

thanks so much for your atention

Link to comment
  
                    local team = getPlayerTeam(player) 
                    if (team) then 
                         r, g, b = getTeamColor( team ) 
                    else 
                         r, g, b = getPlayerNametagColor(player) 
                    end 
                    health = getElementHealth ( player ) 
                    health = math.max(health, 0)/100 
    dxDrawImageSection(drawX, drawY, width, height, math.floor(256 - 256 * (health)), 0, 256, 16, "images/h1.png", 0, 0, 0, tocolor(r, g, b, 200)) 
  

Link to comment

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