Hi guys, so I have this local script which I put in a GUI, It is a health GUI. It seems to be working fine in Studio but it doesn't work when I try it in game.
player = game.Players.LocalPlayer Character = player.Character Humanoid = Character:WaitForChild("Humanoid") GUI = script.Parent HealthGUI = GUI:WaitForChild("Maxhealth") MaxhealthGUI = HealthGUI:WaitForChild("Health") while true do local Value local Percentage = (math.abs(Humanoid.Health-Humanoid.MaxHealth))/Humanoid.MaxHealth if Humanoid.Health > 100 then Value = 1 else Value = 1 - Percentage end MaxhealthGUI:TweenSize(UDim2.new(Value,0,1,0)) wait() end
It updates every time a person dies but then stops working again. So can anyone help?
I don't know what's wrong, I tested it and it worked for me. Try opening output and adding some prints in there.