Humanoid Health & MaxHealth Bug

There is a bug with Humanoids where if you set Health and MaxHealth to values exceeding 100, and then save and re-open the place, the Humanoid’s Health will have dropped back down to 100.

Here is the problem: when a Humanoid is serialized, its Health property is serialized before its MaxHealth property.

<Item class="Humanoid" referent="RBX54951BE3E56A4BFDBFA3DF10BE04029D">
	<Properties>
		<float name="Health_XML">500</float>
		<float name="MaxHealth">500</float>
		<string name="Name">Humanoid</string>
		<token name="NameOcclusion">0</token>
		<float name="WalkSpeed">16</float>
	</Properties>
</Item>

Why is this a problem? Let’s say you set both Health and MaxHealth to 500. When you open the file back up, the Health will have dropped down to 100. This happens because the Health setter is called BEFORE MaxHealth is set, and the Health setter makes it impossible for Health to exceed MaxHealth, so the Health is capped at 100.

I have seen dozens of complaints about this on the forums so I think it’s worth fixing.

2 Likes

I have a similar issue where if you have Humanoids with +100 health before the player joins, they’ll join and only see they have 100/n health where n is maxhealth