function OnUnequipped()if FPSHandsEnbled then local j=DetectRigAsync(MyCharacter)if j=="\082\049\053"then local j={"\076\101\102\116\072\097\110\100";"\076\101\102\116\076\111\119\101\114\065\114\109";"\076\101\102\116\085\112\112\101\114\065\114\109";"\082\105\103\104\116\072\097\110\100";"\082\105\103\104\116\076\111\119\101\114\065\114\109";"\082\105\103\104\116\085\112\112\101\114\065\114\109"}for j,L in pairs(j)do TransparencyConnections[L]:Disconnect()TransparencyConnections[L]=nil end elseif j=="\082\054"then local j={"\082\105\103\104\116 \065\114\109";"\076\101\102\116 \065\114\109"}for j,L in pairs(j)do TransparencyConnections[L]:Disconnect()TransparencyConnections[L]=nil end end if AutoFirstPerson then MyPlayer.CameraMode=Enum.CameraMode.Classic MyPlayer.CameraMinZoomDistance=9.6 task.wait(.02)MyPlayer.CameraMinZoomDistance=(game:GetService("\083\116\097\114\116\101\114\080\108\097\121\101\114")).CameraMinZoomDistance end end Handle.UnequipSound:Play()Handle.EquipSound:Stop()Handle.EquipSound2:Stop()LeftButtonDown=false flare.MuzzleFlash.Enabled=false Reloading=false MyCharacter=nil MyHumanoid=nil MyTorso=nil MyPlayer=nil MyMouse=nil if OnFireConnection then OnFireConnection:disconnect()end if OnReloadConnection then OnReloadConnection:disconnect()end if FlashHolder then FlashHolder=nil end if WeaponGui then WeaponGui.Parent=nil WeaponGui=nil end if RecoilTrack then RecoilTrack:Stop()end if ReloadTrack then ReloadTrack:Stop()end end local function j(j)if WeaponGui and WeaponGui:FindFirstChild("\067\114\111\115\115\104\097\105\114")then for L,u in pairs(WeaponGui.Crosshair:GetChildren())do if u:IsA("\070\114\097\109\101")then u.BorderColor3=j end end end end Tool.Equipped:connect(OnEquipped)Tool.Unequipped:connect(OnUnequipped)while true do task.wait(.033)if WeaponGui and(WeaponGui:FindFirstChild("\067\114\111\115\115\104\097\105\114")and MyMouse)then WeaponGui.Crosshair.Position=UDim2.new(0,MyMouse.X,0,MyMouse.Y)j(NeutralReticleColor)local L=MyMouse.Target if L and L.Parent then local u=PlayersService:GetPlayerFromCharacter(L.Parent)if u then if MyPlayer.Neutral or u.TeamColor~=MyPlayer.TeamColor then j(EnemyReticleColor)else j(FriendlyReticleColor)end end end end if Spread and not IsShooting then local j=time()if j-LastSpreadUpdate>FireRate*2 then LastSpreadUpdate=j Spread=math.max(MinSpread,Spread-AimInaccuracyStepAmount)UpdateCrosshair(Spread,MyMouse)end end end

function OnUnequipped()

	if FPSHandsEnbled then

		local Rig = DetectRigAsync(MyCharacter)

		if Rig == "R15" then
			local WhitelistedBodyParts = {"LeftHand", "LeftLowerArm", "LeftUpperArm", "RightHand", "RightLowerArm", "RightUpperArm"}
			
			for i, v in pairs(WhitelistedBodyParts) do
				TransparencyConnections[v]:Disconnect()
				TransparencyConnections[v] = nil
			end
		elseif Rig == "R6" then
			local WhitelistedBodyParts = {"Right Arm", "Left Arm"}
			
			for i, v in pairs(WhitelistedBodyParts) do
				TransparencyConnections[v]:Disconnect()
				TransparencyConnections[v] = nil
			end
			
		end	

		if AutoFirstPerson then
			MyPlayer.CameraMode = Enum.CameraMode.Classic
			MyPlayer.CameraMinZoomDistance = 9.6
			task.wait(0.02)
			MyPlayer.CameraMinZoomDistance = game:GetService("StarterPlayer").CameraMinZoomDistance
		end
	end

	Handle.UnequipSound:Play()
	Handle.EquipSound:Stop()
	Handle.EquipSound2:Stop()
	LeftButtonDown = false
	flare.MuzzleFlash.Enabled = false
	Reloading = false
	MyCharacter = nil
	MyHumanoid = nil
	MyTorso = nil
	MyPlayer = nil
	MyMouse = nil


	if OnFireConnection then
		OnFireConnection:disconnect()
	end
	if OnReloadConnection then
		OnReloadConnection:disconnect()
	end
	if FlashHolder then
		FlashHolder = nil
	end
	if WeaponGui then
		WeaponGui.Parent = nil
		WeaponGui = nil
	end
	if RecoilTrack then
		RecoilTrack:Stop()
	end
	if ReloadTrack then
		ReloadTrack:Stop()
	end
end

local function SetReticleColor(color)
	if WeaponGui and WeaponGui:FindFirstChild('Crosshair') then
		for _, line in pairs(WeaponGui.Crosshair:GetChildren()) do
			if line:IsA('Frame') then
				line.BorderColor3 = color
			end
		end
	end
end


Tool.Equipped:connect(OnEquipped)
Tool.Unequipped:connect(OnUnequipped)

while true do
	task.wait(0.033)
	if WeaponGui and WeaponGui:FindFirstChild('Crosshair') and MyMouse then
		WeaponGui.Crosshair.Position = UDim2.new(0, MyMouse.X, 0, MyMouse.Y)
		SetReticleColor(NeutralReticleColor)

		local target = MyMouse.Target
		if target and target.Parent then
			local player = PlayersService:GetPlayerFromCharacter(target.Parent)
			if player then
				if MyPlayer.Neutral or player.TeamColor ~= MyPlayer.TeamColor then
					SetReticleColor(EnemyReticleColor)
				else
					SetReticleColor(FriendlyReticleColor)
				end
			end
		end
	end
	if Spread and not IsShooting then
		local currTime = time()
		if currTime - LastSpreadUpdate > FireRate * 2 then
			LastSpreadUpdate = currTime
			Spread = math.max(MinSpread, Spread - AimInaccuracyStepAmount)
			UpdateCrosshair(Spread, MyMouse)
		end
	end
end
