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

How to check your health from a GUI?

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

local h = game.Players.LocalPlayer.Character.Humanoid.Health

1 comment

0

In a localscript

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