Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to define health on player?

Asked by 3 years ago

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

Log in to vote
0
Answered by 3 years ago

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
Ad

Answer this question