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

How can I get the LocalPlayers health, and show it on a gui?

Hey guys!

I wanted to show the health of a player, in a gui. I can't seem to access it.

text = script.Parent

text.Text = game.Players.LocalPlayer.Health

The result is an error. Any ideas?

2 comments

0

Whats the error?

0

change line 3 to text.Text = game.Players.LocalPlayer.Character.Humanoid.Health

1 answer

✓ Accepted answer

The issue is that you are looking for the health inside the player. To easily access the character from the local player quite simple! Just do this

text = script.Parent

text.Text = game.Players.LocalPlayer.Character.Humanoid.Health

1 comment

0

Is this a local script? Also make sure you didn't make a typo. The humanoid should exist unless there's some script that deletes it. And in that case you can't really get the health on the player.

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