I made a working health bar that decreases with the player's health, and it works perfectly on Studio, but it does not respond on Play mode. Any ideas what I am doing wrong?
PD : It is under a LocalScript...
Code :
player = game.Players.LocalPlayer char = player.Character human = char.Humanoid HP = script.Parent while wait() do HP:TweenSize(UDim2.new(0, (human.Health*311)/human.MaxHealth, 0, 24)) if HP.Size.X.Offset <= 165 and HP.Size.X.Offset > 25 then HP.BackgroundColor3 = Color3.new(200/255, 200/255, 0) else if HP.Size.X.Offset <= 25 then HP.BackgroundColor3 = Color3.new(200/255, 0, 0) else HP.BackgroundColor3 = Color3.new(110/255, 185/255, 20/255) end end end
Any help is appreciated!
TheArmoredReaper
Already solved it. Had to add a wait() to let the Client get the Character...
Thanks anyway!