local function U()clipAmmoGUI.Text=Ammo.Value clipAmmoGUI.TextColor3=Ammo.Value<=ClipSize.Value/3 and Color3.new(1,0,0)or Color3.new(1,1,1)end local function N()storedAmmoGUI.Text=StoredAmmo.Value storedAmmoGUI.TextColor3=StoredAmmo.Value<=ClipSize.Value*2 and Color3.new(1,0,0)or Color3.new(1,1,1)end local function u()HUD.Health.Num.Text=CEIL(Humanoid.Health).."\037"HUD.Health.Num.TextColor3=Humanoid.Health>66.666666666667 and Color3.new(1,1,1)or(Humanoid.Health<=66.666666666667 and Humanoid.Health>33.333333333333)and Color3.new(1,1,0)or Humanoid.Health<=33.333333333333 and Color3.new(1,0,0)end local function M(U,N,u)for M,G in pairs(fireModes:GetChildren())do local t=guiAngOffset+90 local L=numLerp((t*U-t*M)-t,(t*N-t*M)-t,Sine(u))+guiAngOffset local z=COS(RAD(L))local y=SIN(RAD(L))G.Position=UDim2.new(.5,z*100,.5,y*100)local E=COS(math.atan2(G.Position.Y.Offset,G.Position.X.Offset)+RAD(90))G.Label.TextTransparency=1-(E/4+.75)local b=E*10+50 G.Label.Position=UDim2.new(0,-b/2,0,0)G.Label.Size=UDim2.new(0,b,0,b/2)end end


local function updateClipAmmo()
	clipAmmoGUI.Text = Ammo.Value
	clipAmmoGUI.TextColor3 = (Ammo.Value <= (ClipSize.Value / 3) and Color3.new(1, 0, 0) or Color3.new(1, 1, 1))
end

local function updateStoredAmmo()
	storedAmmoGUI.Text = StoredAmmo.Value
	storedAmmoGUI.TextColor3 = (StoredAmmo.Value <= (ClipSize.Value * 2) and Color3.new(1, 0, 0) or Color3.new(1, 1, 1))
end

local function updateHealth()
	HUD.Health.Num.Text = CEIL(Humanoid.Health).."%"
	HUD.Health.Num.TextColor3 = (
		(Humanoid.Health > 200 / 3) and Color3.new(1, 1, 1) or
		(Humanoid.Health <= 200 / 3 and Humanoid.Health > 100 / 3) and Color3.new(1, 1, 0) or
		(Humanoid.Health <= 100 / 3) and Color3.new(1, 0, 0)
	)
end

local function updateModeLabels(prevState, newState, X)
	for Num, Mode in pairs(fireModes:GetChildren()) do
		local guiAngOffset2 = guiAngOffset + 90
		local Ang = numLerp(
			(guiAngOffset2 * prevState) - (guiAngOffset2 * Num) - guiAngOffset2,
			(guiAngOffset2 * newState) - (guiAngOffset2 * Num) - guiAngOffset2,
			Sine(X)
		) + guiAngOffset
		local XPos = COS(RAD(Ang))
		local YPos = SIN(RAD(Ang))
		Mode.Position = UDim2.new(0.5, XPos * 100, 0.5, YPos * 100)
		
		local R = COS(math.atan2(Mode.Position.Y.Offset, Mode.Position.X.Offset) + RAD(90))
		Mode.Label.TextTransparency = 1 - ((R / 4) + 0.75)
		
		local Scale = (R * 10) + 50
		Mode.Label.Position = UDim2.new(0, -Scale / 2, 0, 0)
		Mode.Label.Size = UDim2.new(0, Scale, 0, Scale / 2)
	end
end
