Jump to content

Health problem


Blinker.

Recommended Posts

Posted

Hello ,

I've made a script to show health and nos in the bottom of the screen instead of the normal race Health bar ,

the problem is i'm using a percentage , whenever the health reach 25 % the car becomes on fire.. i need the health to be on 0% to become on fire.

i'm using

  
math.round((getElementHealth(getPedOccupiedVehicle(localPlayer))/10),0) 
  

Thanks !

  • Moderators
Posted
local vehicle = getPedOccupiedVehicle(localPlayer) 
if vehicle then 
    local health = getElementHealth(vehicle)-250 
    if health < 0 then 
        health = 0 
    end 
------------------------------------------ 
  
------------------------------------------ 
end 

Posted

Hello IIYAMA,

If I use that , I will get 75% on full health. I need it to be 100% on full health and 0% on fire.

I saw that in many servers like MIKI dd.

Posted

Just check if the health is equal to, or lower than 25%(250). If it is, make the health display 0. I believe it slowly goes from 250 to 0 whilst on fire...?

Posted

I've tried that already , but it will look so shit , the player looks at his health when it's 26% and the next hit it will be 0 %.

I want it to be normal example: 26% then 23% ..till 0 and it will be on fire.

Posted

So make a timer, whenever he's taken to 250 or below - set it to 250 and then start a timer. Find out how long it's on fire before explodes and use that.

Dunno how well it'll work, but might be worth a shot :)

Posted

Aa no , you misunderstood me, I didn't mean that the car becomes on fire on 25% and then goes down till 0

I meant I want it normal like 90 to 87 not going from 25 to 0 ,so whenever the car reaches 0 % of health it becomes on fire.

Normaly the car becomes on fire at 25%...

Thanks.

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