Hey, I'm currently working on a SAO MMORPG inspired game and I'm tryna make the health bar, It is like on top of the player. The problem is that I know how to code health bar but just this is a curved health bar so it's made out of 10 pieces and each piece has a different angle so it looks curved (Look in the image). So to get to the point, I need to know how to make it so that it would work like a normal health bar because the code I wrote doesn't work. Oh and I know it looks messy I just tried lots of things and nothing worked so once it works ill make it tidy.

Image

My code (In a server script):

game:GetService("RunService").Heartbeat:Connect(function()
	if humanoid.Health > 0 then
		for _, v in pairs(parts) do
			if v.Name == "1" and humanoid.Health >= humanoid.MaxHealth - humanoid.MaxHealth / 10 and humanoid.Health <= humanoid.MaxHealth - humanoid.MaxHealth / 10 + 10 then
				v:FindFirstChild("1").Frame.Frame:TweenSize(UDim2.new(10, (-humanoid.Health / humanoid.MaxHealth), 1, 0), "Out", "Linear", 0.2, true)
				v.Parent:FindFirstChild("10"):FindFirstChild("1").Frame.Frame.Visible = false
			end
		end
	end
end)