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

How do I get a player's health via LocalPlayer?

Asked by 10 years ago

I've got a local script, and I want to get the LocalPlayer's health for a Gui, but game.Players.LocalPlayer.Health comes up inconclusive because Health isn't one of the properties of LocalPlayer. How can I use LocalPlayer to find his current Health?

2 answers

Log in to vote
1
Answered by 10 years ago

game.Players.LocalPlayer.Character:WaitForChild("Humanoid").Health

0
if you intend on having it loop, use while wait() do end TigerCaptain 75 — 10y
Ad
Log in to vote
1
Answered by 10 years ago

e = game.Players.LocalPlayer:WaitForChild("Humanoid") e.Health

-- ADVICE , If you want to know his health via gui you can use his health gui, we all have one

HealthGUI = Player.PlayerGui:FindFirstChild("HealthGUI") if HealthGUI ~= nil then -- Do what you want! Just an advice since you're using guis

Answer this question