I'm making a game that required me to make a custom health. I made the custom health and scripted it. But, it seems it's not working fully right.
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false) local player = game.Players.LocalPlayer repeat wait() until player.Character local humanoid = player.Character:WaitForChild("Humanoid") local TheMathPart = humanoid.Health / (humanoid.MaxHealth) script.Parent:TweenSize(UDim2.new(0,-215,0,10), "Out", "Sine", .5) function CustomHealth() local TheMathPart = humanoid.Health / (humanoid.MaxHealth) script.Parent:TweenSize(UDim2.new(TheMathPart,-215,0,10), "Out", "Sine", .5) end humanoid.HealthChanged:connect(CustomHealth)
The thing is that when I made the health 50%, it went down like it was suppose too. But, when the health started regenerating, it would just keep going instead of going back.
Also...when taken damage the health would move to the right, yet I wanted it to go left...if that makes sense. Basically, I want my health to start toward the right, and when taken damage it would move toward the left. Sorry if I'm confusing everybody!
Help would be very appreciated!
Line 7 should be script.Parent:TweenSize(UDim2.new(1,-215,0,10), "Out", "Sine", .5). Use a 1,not a 0 otherwise it won't display.