Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to define health on player?

So my problem I want to solve is where I can define the health of a player and show up and GUI. How can I define health whether if I want to use it on GUI'S or on other parts or whatever, thanks for helps!

1 answer

This would work on a GUI. This is also not a request site!

local player = game.Players.LocalPlayer
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")
game:GetService("RunService").RenderStepped:Connect(function()
script.Parent.Health.Text = humanoid.Health.."/"..humanoid.MaxHealth
end

This discussion is preserved as it was. New answers, comments, and votes are closed.