Blinker. Posted November 20, 2014 Share Posted November 20, 2014 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 ! Link to comment
Moderators IIYAMA Posted November 20, 2014 Moderators Share Posted November 20, 2014 local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle then local health = getElementHealth(vehicle)-250 if health < 0 then health = 0 end ------------------------------------------ ------------------------------------------ end Link to comment
Blinker. Posted November 20, 2014 Author Share Posted November 20, 2014 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. Link to comment
Dealman Posted November 20, 2014 Share Posted November 20, 2014 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...? Link to comment
Blinker. Posted November 20, 2014 Author Share Posted November 20, 2014 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. Link to comment
Dealman Posted November 20, 2014 Share Posted November 20, 2014 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 Link to comment
Blinker. Posted November 21, 2014 Author Share Posted November 21, 2014 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. Link to comment
Saml1er Posted November 21, 2014 Share Posted November 21, 2014 local health = (getElementHealth(vehicle)-250)/750*100 This will return health between 0 and 100. Link to comment
Blinker. Posted November 21, 2014 Author Share Posted November 21, 2014 So Many thanks ! Link to comment
Saml1er Posted November 22, 2014 Share Posted November 22, 2014 So Many thanks ! You're welcome. 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