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

Health script not working?

local health = game.Players.LocalPlayer.Humanoid.Health
local text = script.Parent.TextBox.Text
while wait() do
	text = "Health : ".. health.. ""
end

Console : Humanoid is not a valid member of Player What's the right way? I haven't scripted in forever so I forgot most of what I knew.

1 answer

✓ Accepted answer

The humanoid is located in the character's head, not the player. Your script should look like this:

local health = game.Players.LocalPlayer.Character.Humanoid.Health
local text = script.Parent.TextBox.Text
while wait() do
    text = "Health : ".. health.. ""
end

4 comments

0

Ok thanks

0

Also, do you know how to make a GUI fit the screen without any parts off screen?

0

The humanoid is in the character, not the character's head. game.Players.LocalPlayer.Character.Humanoid

0

Thanks

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