Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

my health bar is not working and i really need help. any comments?

Asked by 1 year ago
Edited 1 year ago

problem: https://i.gyazo.com/f41e08efd30553ac79426e55374934be.gif

the health bar just acts really weird and i have no idea how to fix it

pls help

script:

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")

humanoid.HealthChanged:Connect(function(Damage)
    script.Parent.Size = UDim2.new(Damage/humanoid.MaxHealth,291,0,22)
end)

heres the properties of it:

https://i.gyazo.com/4e0088f5adb63bea4bba67776a84f2bf.png

0
can i ask what ,291,0,22 this part is for? VAnkata20 135 — 1y
0
try this. UDim2.new(0,(char:WaitForChild("Humanoid").Health / char:WaitForChild("Humanoid").MaxHealth * 200),1,0) VAnkata20 135 — 1y

Answer this question