plr = game.Players.LocalPlayer while true do script.Parent.Size.X.Offset = plr.Character.Humanoid.Health * 4 --the parent of this script is the gui wait(.1) end
Here is the correct code:
plr = game.Players.LocalPlayer
while true do script.Parent.Size = UDim2.new(0,plr.Character.Humanoid.Health * 4,1,0) wait(.1)
The second place in the UDim2.new is for offset, while the first is for scale. Hope this helped...