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

Any help with a Health GUI?

Asked by 8 years ago

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)
0
You use too many apostrophes. 1waffle1 2908 — 8y

1 answer

Log in to vote
0
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
8 years ago

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

Ad

Answer this question