Health Questions C#

I was messing around with my UI system and making a health bar, however, I noticed a few things, firstly, when you first spawn in your server you have more health than your max health (I know this has always been a thing), is this suppose to be a thing though, and why?

Secondly, as soon as you die your health switches from 0 to -100, again I don’t know if this is known or supposed to be a thing.

I get these values from calling Game.Player.Character.health & max health or from calling Game.PlayerPed.health & maxHealth.

EDIT:
I found, even more, weirdness, calling Game.player.character.health and Game.PlayerPed.health one after another changes your max health to 75, whereas calling only playerped or player results in the max health being 50.

So I just tried testing my health issue again on an empty server with only a simple script to test it, this script displays health onto the screen, and by pressing “E” ( vehicle horn ) it will disable one of the health checks being drawn and calculated. Pressing (phone up) or (phone down) (“up or down”) you can raise or lower the playerpeds health, and pressing “x” (vehicle duck) you will die.

Feel free to check out the script to understand what I am talking about!
Here is a link to the script: healthtester.zip (3.4 KB)

Do you mind releasing the source code on github or on BitBucket. I want to look through the code to see what you are doing.

i already made health system for my framework , and i experience some strange thing, at least from what i understand but after make some settings , nothing bad or strange, just a game mechanic to understand.

most of time i get the health from PlayerPed and i for a reason i can’t figured it out , i got less trouble by calculating damage or health loss with the health param then the healthfloat.

but for me by touching nothing the default health is at 175 , if you take damage it will lower until 100 and then you die , if you didn’t put the wrislte setting to off and few other option .

and don’t forget you have a regeneration system .

Yeah it seems weird I think it might be because ped and players have different health stats by default, I mean it doesn’t really affect me that much, since I can add in checks to recalculate the health percentage if the player has more health than their max health, I just don’t understand why this would ever be a thing.

nothing is weird in the game health system when you get it .

a ped can have 0 at 200 health
depending the setting you set for your ped , but if you touch nothing ,you start a 175 and when he reach 100 he will die.
you have a lot of setting for activate ou desactivate health option.
i never experienced my health at -100.

Whenever you die the health goes to -100 for me also another side effect of this is your normal health bar like the default gta v one does not fully work as you have to take enough damage to get bellow the max health status for it to show so you can be hit by a car and the health bar will not update since your health is more than the maximum.

i dunno what you did in your script but the health bar working good for me at the first impact

huh, I just installed a fresh server with no mods and it had the same issue, I will try it with the latest server version in a second.

Nope just tested it on the latest windows server with the latest resources and no mods. I could get punched once without the health bar changing as well as fall off something and not lose anything on the health bar until after doing it one or two more times only then the health bar would start to show something. Whereas testing it in single player the first punch from anyone affects the health bar (same goes for falling).