I tried this but it doesn't work, only works in solo mode in studio. I tried it online, it gives me no errors either. And it's in a local script in the Starterpack
local player = script.Parent.Parent.Parent.Parent.Parent.Parent local char = player.Character while true do local humanoid = char:FindFirstChild("Humanoid") if humanoid ~= nil then local bar = script.Parent bar.Size = UDim2.new(- humanoid.Health*-0.006, 0, 0.2, 0) ---Multiplyed it by .006 since total length is .6 and the player has 100 health points. end wait() end
Try changing
local player = script.Parent.Parent.Parent.Parent.Parent.Parent
to
local player = game.Players.LocalPlayer
You said it's in a LocalScript and this only works in local scripts.
Also, try adding 'wait(3)' at the very top of the script.