✓ Accepted answer
Hello MPforfun,
The reason that your code is not working is because you are dividing the amount of the mob's current health by its max health instead of displaying it. Not only that but you should try to avoid .Parent a lot of times. Makes the code look really messy. And we do not need a while loop for this scenario. Here is the fixed script:
local mob = script.Parent.Parent.Parent
local mobHumanoid = mob:WaitForChild("Humanoid")
local UIobject = script.Parent:WaitForChild("HP")
mobHumanoid:GetPropertyChangedSignal("Health"):Connect(function()
UIobject.Text = mobHumanoid.Health.."/"..mobHumanoid.MaxHealth
end)