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

How to check your health from a GUI?

Asked by
JJ_B 250 Moderation Voter
8 years ago

I made a gui, and inside is a TextLabel which displays your health. However, I know that GUIs are in "Players" but health is inside "Humanoid" in your model in "Workspace." I did make a script, but I know it doesn't work.

while true do
    local n = script.Parent.Parent.Parent.Parent.Parent.Name -- TextLabel,Frame,ScreenGui,PlayerGui,Player
    local h = game.Workspace.n.Humanoid.Health
    script.Parent.Text = "Health:" .. h
    wait(0.1)
end

How would I actually do it?

1 answer

Log in to vote
-1
Answered by 8 years ago
local h = game.Players.LocalPlayer.Character.Humanoid.Health
0
In a localscript docrobloxman52 407 — 8y
Ad

Answer this question