--// Input Connections
L_110_.InputBegan:connect(function(L_315_arg1, L_316_arg2)
	if not L_316_arg2 and L_15_ then
		if L_315_arg1.UserInputType == (Enum.UserInputType.MouseButton2 or L_315_arg1.KeyCode == Enum.KeyCode.ButtonL2) and not L_79_ and not L_78_ and not L_77_ and L_24_.CanAim and not L_74_ and L_15_ and not L_66_ and not L_67_ then
			if not L_64_ then
				if not L_65_ then
					L_157_ = 0.015
					L_158_ = 7
					L_3_:WaitForChild("Humanoid").WalkSpeed = 7
				end
				
				if (L_3_.Head.Position - L_5_.CoordinateFrame.p).magnitude <= 2 then
					L_97_ = L_50_
				end
				L_136_.target = L_56_.CFrame:toObjectSpace(L_44_.CFrame).p
				L_98_.SoundId = 'rbxassetid://' .. L_102_[math.random(1, #L_102_)]
				L_98_:Play()
				L_118_:FireServer(true)				
				L_64_ = true
			end
		end;
		
		if L_315_arg1.KeyCode == Enum.KeyCode.A and L_15_ then
			L_137_ = CFrame.Angles(0, 0, 0.1)
		end;
		
		if L_315_arg1.KeyCode == Enum.KeyCode.D and L_15_ then
			L_137_ = CFrame.Angles(0, 0, -0.1)
		end;
		
		if L_315_arg1.KeyCode == Enum.KeyCode.E and L_15_ and not L_80_ and not L_81_ then
			L_80_ = true
			L_82_ = false
			L_81_ = true
			LeanRight()
		end
		
		if L_315_arg1.KeyCode == Enum.KeyCode.Q and L_15_ and not L_80_ and not L_82_ then
			L_80_ = true
			L_81_ = false
			L_82_ = true
			LeanLeft()
		end
		
		if L_315_arg1.KeyCode == L_24_.AlternateAimKey and not L_79_ and not L_78_ and not L_77_ and L_24_.CanAim and not L_74_ and L_15_ and not L_66_ and not L_67_ then
			if not L_64_ then
				if not L_65_ then
					L_3_.Humanoid.WalkSpeed = 10
					L_158_ = 10
					L_157_ = 0.008
				end
				L_97_ = L_50_
				L_136_.target = L_56_.CFrame:toObjectSpace(L_44_.CFrame).p
				L_98_.SoundId = 'rbxassetid://' .. L_102_[math.random(1, #L_102_)]
				L_98_:Play()
				L_118_:FireServer(true)
				L_64_ = true
			end
		end;
		
		if L_315_arg1.UserInputType == (Enum.UserInputType.MouseButton1 or L_315_arg1.KeyCode == Enum.KeyCode.ButtonR2) and not L_79_ and not L_77_ and L_69_ and L_15_ and not L_66_ and not L_67_ and not L_74_ then
			L_68_ = true
			if not Shooting and L_15_ and not L_83_ then
				if L_106_ > 0 then			
					Shoot()
				end
			elseif not Shooting and L_15_ and L_83_ then
				if L_108_ > 0 then
					Shoot()
				end
			end
		end;
		
		if L_315_arg1.KeyCode == (L_24_.LaserKey or L_315_arg1.KeyCode == Enum.KeyCode.DPadRight) and L_15_ and L_24_.LaserAttached then
			local L_317_ = L_1_:FindFirstChild("LaserLight")
			L_125_.KeyDown[1].Plugin()
		end;
		
		if L_315_arg1.KeyCode == (L_24_.LightKey or L_315_arg1.KeyCode == Enum.KeyCode.ButtonR3) and L_15_ and L_24_.LightAttached then
			local L_318_ = L_1_:FindFirstChild("FlashLight"):FindFirstChild('Light')
			local L_319_ = false
			L_318_.Enabled = not L_318_.Enabled
		end;
		
		if L_15_ and L_315_arg1.KeyCode == (L_24_.FireSelectKey or L_315_arg1.KeyCode == Enum.KeyCode.DPadUp) and not L_79_ and not L_70_ and not L_78_ then
			L_70_ = true
			if L_92_ == 1 then
				if Shooting then
					Shooting = false
				end
				if L_24_.AutoEnabled then
					L_92_ = 2
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.AutoEnabled and L_24_.BurstEnabled then
					L_92_ = 3
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.AutoEnabled and not L_24_.BurstEnabled and L_24_.BoltAction then
					L_92_ = 4
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.AutoEnabled and not L_24_.BurstEnabled and not L_24_.BoltAction and L_24_.ExplosiveEnabled then
					L_92_ = 6
					L_83_ = true
					L_84_ = L_69_
					L_69_ = L_85_
				elseif not L_24_.AutoEnabled and not L_24_.BurstEnabled and not L_24_.BoltAction and not L_24_.ExplosiveEnabled then
					L_92_ = 1
					L_83_ = false
					L_69_ = L_84_
				end
			elseif L_92_ == 2 then
				if Shooting then
					Shooting = false
				end
				if L_24_.BurstEnabled then
					L_92_ = 3
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.BurstEnabled and L_24_.BoltAction then
					L_92_ = 4
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.BurstEnabled and not L_24_.BoltAction and L_24_.ExplosiveEnabled then
					L_92_ = 6
					L_83_ = true
					L_84_ = L_69_
					L_69_ = L_85_
				elseif not L_24_.BurstEnabled and not L_24_.BoltAction and not L_24_.ExplosiveEnabled and L_24_.SemiEnabled then
					L_92_ = 1
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.BurstEnabled and not L_24_.BoltAction and not L_24_.SemiEnabled then
					L_92_ = 2
					L_83_ = false
					L_69_ = L_84_
				end
			elseif L_92_ == 3 then
				if Shooting then
					Shooting = false
				end
				if L_24_.BoltAction then
					L_92_ = 4
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.BoltAction and L_24_.ExplosiveEnabled then
					L_92_ = 6
					L_83_ = true
					L_84_ = L_69_
					L_69_ = L_85_
				elseif not L_24_.BoltAction and not L_24_.ExplosiveEnabled and L_24_.SemiEnabled then
					L_92_ = 1
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.BoltAction and not L_24_.SemiEnabled and L_24_.AutoEnabled then
					L_92_ = 2
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.BoltAction and not L_24_.SemiEnabled and not L_24_.AutoEnabled then
					L_92_ = 3
					L_83_ = false
					L_69_ = L_84_
				end
			elseif L_92_ == 4 then
				if Shooting then
					Shooting = false
				end
				if L_24_.ExplosiveEnabled then
					L_92_ = 6
					L_83_ = true
					L_84_ = L_69_
					L_69_ = L_85_
				elseif not L_24_.ExplosiveEnabled and L_24_.SemiEnabled then
					L_92_ = 1
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.SemiEnabled and L_24_.AutoEnabled then
					L_92_ = 2
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and L_24_.BurstEnabled then
					L_92_ = 3
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and not L_24_.BurstEnabled then
					L_92_ = 4
					L_83_ = false
					L_69_ = L_84_
				end
			elseif L_92_ == 6 then
				if Shooting then
					Shooting = false
				end
				L_85_ = L_69_
				if L_24_.SemiEnabled then
					L_92_ = 1
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.SemiEnabled and L_24_.AutoEnabled then
					L_92_ = 2
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and L_24_.BurstEnabled then
					L_92_ = 3
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and not L_24_.BurstEnabled and L_24_.BoltAction then
					L_92_ = 4
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and not L_24_.BurstEnabled and not L_24_.BoltAction then
					L_92_ = 6
					L_83_ = true
					L_84_ = L_69_
					L_69_ = L_85_
				end
			end
			UpdateAmmo()
			FireModeAnim()
			IdleAnim()
			L_70_ = false
		end;
		
		if L_315_arg1.KeyCode == (Enum.KeyCode.F or L_315_arg1.KeyCode == Enum.KeyCode.DPadDown) and not L_79_ and not L_77_ and not L_78_ and not L_67_ and not L_70_ and not L_64_ and not L_66_ and not Shooting and not L_76_ then			
			if not L_73_ and not L_74_ then
				L_74_ = true
				Shooting = false
				L_69_ = false
				L_138_ = time()
				delay(0.6, function()
					if L_106_ ~= L_24_.Ammo and L_106_ > 0 then
						CreateShell()
					end
				end)	
				BoltBackAnim()
				L_73_ = true
			elseif L_73_ and L_74_ then
				BoltForwardAnim()
				Shooting = false
				L_69_ = true
				if L_106_ ~= L_24_.Ammo and L_106_ > 0 then
					L_106_ = L_106_ - 1
				elseif L_106_ >= L_24_.Ammo then
					L_69_ = true
				end						
				L_73_ = false
				L_74_ = false
				IdleAnim()
				L_75_ = false
			end
			UpdateAmmo()
		end;
		
		if L_315_arg1.KeyCode == (Enum.KeyCode.LeftShift or L_315_arg1.KeyCode == Enum.KeyCode.ButtonL3) and not L_78_ and not L_77_ and L_149_ then
			L_71_ = true
			if L_15_ and not L_70_ and not L_67_ and L_71_ and not L_65_ and not L_74_ then
				Shooting = false
				L_64_ = false
				L_67_ = true
						
				delay(0, function()
					if L_67_ and not L_66_ then
						L_64_ = false
						L_72_ = true
					end
				end)
				L_97_ = 80
				L_157_ = 0.4
				L_158_ = 16
				L_3_.Humanoid.WalkSpeed = L_24_.SprintSpeed
			end
		end;
		
		if L_315_arg1.KeyCode == (Enum.KeyCode.R or L_315_arg1.KeyCode == Enum.KeyCode.ButtonX) and not L_79_ and not L_78_ and not L_77_ and L_15_ and not L_66_ and not L_64_ and not Shooting and not L_67_ and not L_74_ then		
			if not L_83_ then			
				if L_107_ > 0 and L_106_ < L_24_.Ammo then
					Shooting = false
					L_66_ = true
					
					for L_320_forvar1, L_321_forvar2 in pairs(game.Players:GetChildren()) do
						if L_321_forvar2 and L_321_forvar2:IsA('Player') and L_321_forvar2 ~= L_2_ and L_321_forvar2.TeamColor == L_2_.TeamColor then
							if (L_321_forvar2.Character.HumanoidRootPart.Position - L_3_.HumanoidRootPart.Position).magnitude  <= 150 then
								if L_7_:FindFirstChild('AHH') and not L_7_.AHH.IsPlaying and L_24_.CanCallout then
									L_122_:FireServer(L_7_.AHH, L_101_[math.random(0, 23)])
								end
							end
						end
					end
					
					ReloadAnim()
					if L_106_ <= 0 then
						if not L_24_.CanSlideLock then
							BoltBackAnim()
							BoltForwardAnim()
						end
					end
					IdleAnim()
					L_69_ = true
					
					if L_106_ <= 0 then
						if (L_107_ - (L_24_.Ammo - L_106_)) < 0 then
							L_106_ = L_106_ + L_107_
							L_107_ = 0
						else
							L_107_ = L_107_ - (L_24_.Ammo - L_106_)
							L_106_ = L_24_.Ammo
						end
					elseif L_106_ > 0 then
						if (L_107_ - (L_24_.Ammo - L_106_)) < 0 then
							L_106_ = L_106_ + L_107_ + 1
							L_107_ = 0
						else
							L_107_ = L_107_ - (L_24_.Ammo - L_106_)
							L_106_ = L_24_.Ammo + 1
						end
					end
	
					L_66_ = false
					if not L_75_ then
						L_69_ = true
					end
				end;
			elseif L_83_ then
				if L_108_ > 0 then
					Shooting = false
					L_66_ = true
					nadeReload()
					IdleAnim()
					L_66_ = false
					L_69_ = true
				end
			end;
			UpdateAmmo()
		end;
		
		if L_315_arg1.KeyCode == Enum.KeyCode.RightBracket and L_64_ then
			if (L_51_ < 1) then
				L_51_ = L_51_ + L_24_.SensitivityIncrement
			end
		end
		
		if L_315_arg1.KeyCode == Enum.KeyCode.LeftBracket and L_64_ then
			if (L_51_ > 0.1) then
				L_51_ = L_51_ - L_24_.SensitivityIncrement
			end
		end
		
		if L_315_arg1.KeyCode == (Enum.KeyCode.T or L_315_arg1.KeyCode == Enum.KeyCode.DPadLeft) and L_1_:FindFirstChild("AimPart2") then
			if not L_86_ then
				L_56_ = L_1_:WaitForChild("AimPart2")
				L_50_ = L_24_.CycleAimZoom
				if L_64_ then
					L_97_ = L_24_.CycleAimZoom
				end
				L_86_ = true
			else
				L_56_ = L_1_:FindFirstChild("AimPart")
				L_50_ = L_24_.AimZoom
				if L_64_ then
					L_97_ = L_24_.AimZoom
				end
				L_86_ = false
			end;
		end;
		
		if L_315_arg1.KeyCode == L_24_.InspectionKey and not L_79_ and not L_78_ then
			if not L_77_ then
				L_77_ = true
				InspectAnim()
				IdleAnim()
				L_77_ = false
			end
		end;
		
		if L_315_arg1.KeyCode == L_24_.AttachmentKey and not L_79_ and not L_77_ then
			if L_15_ then
				if not L_78_ then
					L_67_ = false
					L_64_ = false
					L_69_ = false
					L_78_ = true
					
					AttachAnim()
				elseif L_78_ then
					L_67_ = false
					L_64_ = false
					L_69_ = true
					L_78_ = false
					
					IdleAnim()
				end
			end
		end;
			
		if L_315_arg1.KeyCode == Enum.KeyCode.P and not L_77_ and not L_78_ and not L_64_ and not L_67_ and not L_65_ and not L_66_ and not Recoiling and not L_67_ then
			if not L_79_ then
				L_79_ = true
				L_14_:Create(L_45_, TweenInfo.new(0.2), {
					C1 = L_24_.SprintPos
				}):Play()
				wait(0.2)
				L_115_:FireServer("Patrol", L_24_.SprintPos)
			else
				L_79_ = false
				L_14_:Create(L_45_, TweenInfo.new(0.2), {
					C1 = CFrame.new()
				}):Play()
				wait(0.2)
				L_115_:FireServer("Unpatrol")
			end
		end;
	end
end)

L_110_.InputEnded:connect(function(L_322_arg1, L_323_arg2)
	if not L_323_arg2 and L_15_ then
		if L_322_arg1.UserInputType == (Enum.UserInputType.MouseButton2 or L_322_arg1.KeyCode == Enum.KeyCode.ButtonL2) and not L_77_ and L_24_.CanAim and not L_78_ then
			if L_64_ then
				if not L_65_ then
					L_3_:WaitForChild("Humanoid").WalkSpeed = 16
					L_157_ = 0.09
					L_158_ = 11
				end	
				L_97_ = 70
				L_136_.target = Vector3.new()
				L_98_.SoundId = 'rbxassetid://' .. L_103_[math.random(1, #L_103_)]
				L_98_:Play()
				L_118_:FireServer(false)
				L_64_ = false
			end
		end;
		
		if L_322_arg1.KeyCode == Enum.KeyCode.A and L_15_ then
			L_137_ = CFrame.Angles(0, 0, 0)
		end;
		
		if L_322_arg1.KeyCode == Enum.KeyCode.D and L_15_ then
			L_137_ = CFrame.Angles(0, 0, 0)
		end;
		
		if L_322_arg1.KeyCode == Enum.KeyCode.E and L_15_ and L_80_ then
			Unlean()		
			L_80_ = false
			L_82_ = false
			L_81_ = false
		end
		
		if L_322_arg1.KeyCode == Enum.KeyCode.Q and L_15_ and L_80_ then
			Unlean()		
			L_80_ = false
			L_82_ = false
			L_81_ = false
		end
		
		if L_322_arg1.KeyCode == L_24_.AlternateAimKey and not L_77_ and L_24_.CanAim then
			if L_64_ then
				if not L_65_ then
					L_3_.Humanoid.WalkSpeed = 16
					L_158_ = 17
					L_157_ = .25
				end	
				L_97_ = 70
				L_136_.target = Vector3.new()
				L_136_.target = Vector3.new()
				L_98_.SoundId = 'rbxassetid://' .. L_103_[math.random(1, #L_103_)]
				L_118_:FireServer(false)
				L_64_ = false
			end
		end;
		
		if L_322_arg1.UserInputType == (Enum.UserInputType.MouseButton1 or L_322_arg1.KeyCode == Enum.KeyCode.ButtonR2) and not L_77_ then
			L_68_ = false				
			if Shooting then
				Shooting = false
			end
		end;
		
		if L_322_arg1.KeyCode == Enum.KeyCode.E and L_15_ then
			local L_324_ = L_42_:WaitForChild('GameGui')
			if L_16_ then
				L_324_:WaitForChild('AmmoFrame').Visible = false
				L_16_ = false
			end
		end;
		
		if L_322_arg1.KeyCode == (Enum.KeyCode.LeftShift or L_322_arg1.KeyCode == Enum.KeyCode.ButtonL3) and not L_77_ and not L_70_ and not L_65_ then -- SPRINT
			L_71_ = false
			if L_67_ and not L_64_ and not Shooting and not L_71_ then
				L_67_ = false
				L_72_ = false
				L_97_ = 70
			
				L_3_.Humanoid.WalkSpeed = 16
				L_157_ = 0.09
				L_158_ = 11	
			end
		end;
	end
end)

L_110_.InputChanged:connect(function(L_325_arg1, L_326_arg2)
	if not L_326_arg2 and L_15_ and L_24_.FirstPersonOnly and L_64_ then
		if L_325_arg1.UserInputType == Enum.UserInputType.MouseWheel then
			if L_325_arg1.Position.Z == 1 and (L_51_ < 1) then
				L_51_ = L_51_ + L_24_.SensitivityIncrement
			elseif L_325_arg1.Position.Z == -1 and (L_51_ > 0.1) then
				L_51_ = L_51_ - L_24_.SensitivityIncrement
			end
		end
	end
end)

L_110_.InputChanged:connect(function(L_327_arg1, L_328_arg2)
	if not L_328_arg2 and L_15_ then
		local L_329_, L_330_ = workspace:FindPartOnRayWithIgnoreList(Ray.new(L_56_.CFrame.p, (L_56_.CFrame.lookVector).unit * 10000), IgnoreList);
		if L_329_ then
			local L_331_ = (L_330_ - L_6_.Position).magnitude
			L_33_.Text = math.ceil(L_331_) .. ' m'
		end
	end
end)