local function w()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 z()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 y()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 o(w,z,y)for o,c in pairs(fireModes:GetChildren())do local D=guiAngOffset+90 local N=numLerp((D*w-D*o)-D,(D*z-D*o)-D,Sine(y))+guiAngOffset local t=COS(RAD(N))local L=SIN(RAD(N))c.Position=UDim2.new(.5,t*100,.5,L*100)local H=COS(math.atan2(c.Position.Y.Offset,c.Position.X.Offset)+RAD(90))c.Label.TextTransparency=1-(H/4+.75)local F=H*10+50 c.Label.Position=UDim2.new(0,-F/2,0,0)c.Label.Size=UDim2.new(0,F,0,F/2)end end
--------------------[ GUI UPDATE FUNCTIONS ]------------------------------------------

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
