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

Health script not working?

Asked by 8 years ago
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

Log in to vote
-1
Answered by 8 years ago

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

0
Ok thanks theawesome624 100 — 8y
0
Also, do you know how to make a GUI fit the screen without any parts off screen? theawesome624 100 — 8y
0
The humanoid is in the character, not the character's head. game.Players.LocalPlayer.Character.Humanoid drahsid5 250 — 8y
0
Thanks grasheeno 70 — 8y
Ad

Answer this question