#HP Bar not working

5 messages · Page 1 of 1 (latest)

dusky hemlock
#

local hp = 100
local char = game.Players.Localplayer.Character

local function update_bar()
script.Parent.Bar:TweenSize(UDim2.new(hp/100, 0, 1, 0), UDim2.new(0, 0, 0, 0), "Out", "Linear", 0.15, true)
end

local function update_char(char)
char:WaitForChild("Humanoid"):GetPropertyChangedSignal("Health"):Connect(function()
hp = char.Humanoid.Health
update_bar()
end)
end

update_bar()
update_bar(char)

game.Players.LocalPlayer.CharacterAdded:Connect(function(c)
char = c
update_char(c)
hp = 100
update_bar()
end)

barren jewel
#

might be the fact that the p in LocalPlayer on line 2 is lowercase but i have no clue xd

dusky hemlock
#

Still not working, sadly

lone craterBOT
#

studio** You are now Level 1! **studio