Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Custom health bar not regenerating?

My custom health bar is working fine other then the fact that it keeps going down instead of regenerating back up.

game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)

local player = game.Players.LocalPlayer.Character
repeat wait() until player
local humanoid = player:WaitForChild("Humanoid")
local TheMathPart = humanoid.Health / (humanoid.MaxHealth)


function TheHealthbar()
	local TheMathPart = humanoid.Health / (humanoid.MaxHealth)
	script.Parent:TweenSize(UDim2.new(0, 25,TheMathPart, -180), "Out" ,"Sine", .5)
end

humanoid.HealthChanged:connect(TheHealthbar)

Help would be appreciated.

1 comment

1

Could it be that your override is set to false as you have not changed it from the default value. Try adding true to the end of the arguments for TweenSize.

1 answer

Y u be setting TheMathPart twice

2 comments

0

Because it's not a constant, the user's health changes, please use the comments to post stuff like this, otherwise it looks like the question has been answered.

0

That's what I'm saying, only have it in the HealthChanged function lol

This discussion is preserved as it was. New answers, comments, and votes are closed.