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

Any help with a Health GUI?

Can someone tell me why this Health GUI won't work? Output give's no error's.

local player = game.Players.LocalPlayer
local char = player:WaitForChild("Character")
local text = script.Parent:WaitForChild("Text")
local frame = script.Parent:WaitForChild("ColorFrame")

game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Health,false)

char.Humanoid.HealthChanged:connect(function()
	frame:TweenSize(UDim2.new(0,2*char.Humanoid.Health,1,0),"Out","Quad",0.1)
	text.Text = "Health: "..math.floor(char.Humanoid.Health).." / "..char.Humanoid.MaxHealth
end)

1 comment

0

You use too many apostrophes.

1 answer

✓ Accepted answer

Character is not a child of Player. Line 2 should be local char = player.CharacterAdded:wait()

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