To sum it up and make this quick, the health bar i made is just not working with me. When i changed the players health to 70, the health bar goes all the way down for some reason. Here are some pictures:

Before Health Change: https://gyazo.com/0e44cb929a125580ab3a1f08ecdfc2f8

After Health Change: https://gyazo.com/9f2918e72b5037f276f8b5d6044a6330

Script:

--\\Player Variables
local Player = game.Players.LocalPlayer
Player.CharacterAdded:wait()
local Character = Player.Character
local Humanoid = Character:FindFirstChild("Humanoid")

--\\Change Frame When Humanoid Changes Health
Humanoid.HealthChanged:connect(function()
    local hp = Humanoid.Health/Humanoid.MaxHealth
    script.Parent:TweenSize(UDim2.new(hp, 0, 0, 25),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,0.5,true)
end)

2 comments

1

try "hp = (100/Humanoid.MaxHealth)*Humanoid.Health" to get a percentage.

0

Thanks!