local player = script.Parent.Parent.Parent.Parent.Parent player.Humanoid.Changed:connect(function() local redhealth = player.Humanoid.MaxHealth / 4 if player.Humanoid.Health <= redhealth then script.Parent.BackgroundColor3 = Color3.new(255,0,0) end if player.Humanoid.Health > redhealth then local brickcolor = BrickColor.new("Lime green") local color = brickcolor.Color script.Parent.BackgroundColor3 = color end script.Parent.Size= UDim2.new(0,(player:WaitForChild("Humanoid").Health / player:WaitForChild("Humanoid").MaxHealth * 200),1,0) end)
when players health is low the gui glitches the red bar goes bigger then the backgorund. please help. when you zoom out the red bar is not the same size as the background gui so like when i zoom it the red bar's size increases and when i zoom in it decreases. if you do not understand what i am trying to say post a comment then i will show you what i mean.
Instead of doing UDim2.new(0,(player:WaitForChild("Humanoid").Health / player:WaitForChild("Humanoid").MaxHealth * 200),1,0)
do UDim2.new(player:WaitForChild("Humanoid").Health / player:WaitForChild("Humanoid").MaxHealth, 0, 1, 0)