I'm trying to make a custom health bar for a game I'm making. The script runs perfectly when I test it in studio, but once i try on roblox's website, it messes up. Once i die, the health bar doesn't go down until after I respawn and it just stays down even though i'm alive.
Here is the script for any interested-
- local plr = game.Players.LocalPlayer.Character
- while true do
- script.Parent:TweenSize(UDim2.new(plr.Humanoid.Health/plr.Humanoid.MaxHealth, 0, 1, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1)
- wait(0.1)
- end

1 comment
Use code blocks, instead.