So I made a health gui that displays your current health (obviously) but when the health is being shown in numbers, it goes all the way to the decimals and I want it to round to the nearest 1 digit.
I also want to talk about how the max health on a player is set to 255 but after the humanoid gets damaged, it only heals up to 100.
To fix the rounding issue, you can use math.floor().
To fix the healing issue, you could probably try setting Humanoid.MaxHealth and Humanoid.Health to 255.
local TextHP = script.Parent
local Player = game.Players.LocalPlayer
local Char = Player.Character or Player.CharacterAdded:Wait()
while wait() do
TextHP.Text ="Health:"..math.floor(Char:WaitForChild("Humanoid").Health).."/"..math.floor(Char:WaitForChild("Humanoid").MaxHealth)
end
If you’re changing the health on client side then the hp will be back to 100 try change it on server side
I also want to talk about how the max health on a player is set to 255 but after the humanoid gets damaged, it only heals up to 100.
This sounds like a client-server replication issue, i.e; you’re setting the player’s humanoid’s ‘MaxHealth’ property to 255 on the client, this change will not reflect to the server meaning that from the server’s perspective the humanoid’s ‘MaxHealth’ property is still 100 and thus the ‘Health’ script which automatically heals player’s humanoids only heals the humanoid back to 100 health.