- Joined
- Sep 10, 2013
- Messages
- 155
- Reaction score
- 9
- First Language
- English
- Primarily Uses
So I've got three variables. One is PlayerHP, another is PlayerMaxHP and the last one is HPPercentage. I want to get a percentage between PlayerHP and PlayerMaxHP and store it into HPPercentage.
- When initialized PlayerHP = 100 and PlayerMaxHP = 100.
- I take PlayerHP and store it into HPPercentage
- I then take HPPercentage and divide it by PlayerMaxHP
- then I muiltiply HPPercentage by 100 and I should get the result.
At first when both PlayerHP and PlayerMaxHP are the same being 100 it works perfectly fine. I get a percentage output of 100. But the second PlayerHP drops below the 100 then something goes wrong and I get a Percentage output of 0. If PlayerHP is above PlayerMaxHP I get an output of 100 when it should be higher than 100. What is going on here?
- When initialized PlayerHP = 100 and PlayerMaxHP = 100.
- I take PlayerHP and store it into HPPercentage
- I then take HPPercentage and divide it by PlayerMaxHP
- then I muiltiply HPPercentage by 100 and I should get the result.
At first when both PlayerHP and PlayerMaxHP are the same being 100 it works perfectly fine. I get a percentage output of 100. But the second PlayerHP drops below the 100 then something goes wrong and I get a Percentage output of 0. If PlayerHP is above PlayerMaxHP I get an output of 100 when it should be higher than 100. What is going on here?

