I have a custom health bar I don't want it to take up all the space to make room for an image If you could help me optimize my code that would be great
local startergui = game:GetService('StarterGui')
startergui:SetCoreGuiEnabled(Enum.CoreGuiType.Health, false)
local LocalPlayer = game.Players.LocalPlayer
local LocalChar = LocalPlayer.Character
local LocalHumanoid = LocalChar:WaitForChild("Humanoid")
LocalHumanoid:GetPropertyChangedSignal("Health"):connect(function()
local redzone = LocalHumanoid.MaxHealth / 4
if LocalHumanoid.Health <= redzone then
end
if LocalHumanoid.Health > redzone then
end
script.Parent.Size = UDim2.new(LocalHumanoid.Health / LocalHumanoid.MaxHealth,0,script.Parent.Size.Y.Scale,0)
end)

1 comment
It moves on the X not the Y