--// Input Connections
L_101_.InputBegan:connect(function(L_303_arg1, L_304_arg2)
	if not L_304_arg2 and L_15_ then
		if L_303_arg1.UserInputType == Enum.UserInputType.MouseButton2 or L_303_arg1.KeyCode == Enum.KeyCode.ButtonL2 and not L_75_ and not L_74_ and L_24_.CanAim and not L_71_ and L_15_ and not L_63_ and not L_64_ then
			if not L_61_ then
				if not L_62_ then
					L_3_.Humanoid.WalkSpeed = 10
					L_148_ = 10
					L_147_ = 0.008
				end
				
				if (L_3_.Head.Position - L_5_.CoordinateFrame.p).magnitude <= 2 then
					L_93_ = L_50_
				end
				L_126_.target = L_53_.CFrame:toObjectSpace(L_44_.CFrame).p
				L_109_:FireServer(true)				
				L_61_ = true
			end
		end;
		
		if L_303_arg1.KeyCode == Enum.KeyCode.E and L_15_ and not L_76_ and not L_77_ then
			L_76_ = true
			L_78_ = false
			L_77_ = true
			LeanRight()
		end
		
		if L_303_arg1.KeyCode == Enum.KeyCode.Q and L_15_ and not L_76_ and not L_78_ then
			L_76_ = true
			L_77_ = false
			L_78_ = true
			LeanLeft()
		end
		
		if L_303_arg1.KeyCode == L_24_.AlternateAimKey and not L_75_ and not L_74_ and L_24_.CanAim and not L_71_ and L_15_ and not L_63_ and not L_64_ then
			if not L_61_ then
				if not L_62_ then
					L_3_.Humanoid.WalkSpeed = 10
					L_148_ = 10
					L_147_ = 0.008
				end
				L_93_ = L_50_
				L_126_.target = L_53_.CFrame:toObjectSpace(L_44_.CFrame).p
				L_109_:FireServer(true)
				L_61_ = true
			end
		end;
		
		if L_303_arg1.UserInputType == Enum.UserInputType.MouseButton1 or L_303_arg1.KeyCode == Enum.KeyCode.ButtonR2 and not L_74_ and L_66_ and L_15_ and not L_63_ and not L_64_ and not L_71_ then
			L_65_ = true
			if not Shooting and L_15_ and not L_79_ then
				if L_97_ > 0 then			
					Shoot()
				end
			elseif not Shooting and L_15_ and L_79_ then
				if L_99_ > 0 then
					Shoot()
				end
			end
		end;
		
		if L_303_arg1.KeyCode == L_24_.LaserKey or L_303_arg1.KeyCode == Enum.KeyCode.DPadRight and L_15_ and L_24_.LaserAttached then
			local L_305_ = L_1_:FindFirstChild("LaserLight")
			L_115_.KeyDown[1].Plugin()
		end;
		
		if L_303_arg1.KeyCode == L_24_.LightKey or L_303_arg1.KeyCode == Enum.KeyCode.ButtonR3 and L_15_ and L_24_.LightAttached then
			local L_306_ = L_1_:FindFirstChild("FlashLight"):FindFirstChild('Light')
			local L_307_ = false
			L_306_.Enabled = not L_306_.Enabled
		end;
		
		if L_15_ and L_303_arg1.KeyCode == L_24_.FireSelectKey or L_303_arg1.KeyCode == Enum.KeyCode.DPadUp and not L_67_ and not L_75_ then
			L_67_ = true
			if L_88_ == 1 then
				if Shooting then
					Shooting = false
				end
				if L_24_.AutoEnabled then
					L_88_ = 2
					L_79_ = false
					L_66_ = L_80_
				elseif not L_24_.AutoEnabled and L_24_.BurstEnabled then
					L_88_ = 3
					L_79_ = false
					L_66_ = L_80_
				elseif not L_24_.AutoEnabled and not L_24_.BurstEnabled and L_24_.BoltAction then
					L_88_ = 4
					L_79_ = false
					L_66_ = L_80_
				elseif not L_24_.AutoEnabled and not L_24_.BurstEnabled and not L_24_.BoltAction and L_24_.ExplosiveEnabled then
					L_88_ = 6
					L_79_ = true
					L_80_ = L_66_
					L_66_ = L_81_
				elseif not L_24_.AutoEnabled and not L_24_.BurstEnabled and not L_24_.BoltAction and not L_24_.ExplosiveEnabled then
					L_88_ = 1
					L_79_ = false
					L_66_ = L_80_
				end
			elseif L_88_ == 2 then
				if Shooting then
					Shooting = false
				end
				if L_24_.BurstEnabled then
					L_88_ = 3
					L_79_ = false
					L_66_ = L_80_
				elseif not L_24_.BurstEnabled and L_24_.BoltAction then
					L_88_ = 4
					L_79_ = false
					L_66_ = L_80_
				elseif not L_24_.BurstEnabled and not L_24_.BoltAction and L_24_.ExplosiveEnabled then
					L_88_ = 6
					L_79_ = true
					L_80_ = L_66_
					L_66_ = L_81_
				elseif not L_24_.BurstEnabled and not L_24_.BoltAction and not L_24_.ExplosiveEnabled and L_24_.SemiEnabled then
					L_88_ = 1
					L_79_ = false
					L_66_ = L_80_
				elseif not L_24_.BurstEnabled and not L_24_.BoltAction and not L_24_.SemiEnabled then
					L_88_ = 2
					L_79_ = false
					L_66_ = L_80_
				end
			elseif L_88_ == 3 then
				if Shooting then
					Shooting = false
				end
				if L_24_.BoltAction then
					L_88_ = 4
					L_79_ = false
					L_66_ = L_80_
				elseif not L_24_.BoltAction and L_24_.ExplosiveEnabled then
					L_88_ = 6
					L_79_ = true
					L_80_ = L_66_
					L_66_ = L_81_
				elseif not L_24_.BoltAction and not L_24_.ExplosiveEnabled and L_24_.SemiEnabled then
					L_88_ = 1
					L_79_ = false
					L_66_ = L_80_
				elseif not L_24_.BoltAction and not L_24_.SemiEnabled and L_24_.AutoEnabled then
					L_88_ = 2
					L_79_ = false
					L_66_ = L_80_
				elseif not L_24_.BoltAction and not L_24_.SemiEnabled and not L_24_.AutoEnabled then
					L_88_ = 3
					L_79_ = false
					L_66_ = L_80_
				end
			elseif L_88_ == 4 then
				if Shooting then
					Shooting = false
				end
				if L_24_.ExplosiveEnabled then
					L_88_ = 6
					L_79_ = true
					L_80_ = L_66_
					L_66_ = L_81_
				elseif not L_24_.ExplosiveEnabled and L_24_.SemiEnabled then
					L_88_ = 1
					L_79_ = false
					L_66_ = L_80_
				elseif not L_24_.SemiEnabled and L_24_.AutoEnabled then
					L_88_ = 2
					L_79_ = false
					L_66_ = L_80_
				elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and L_24_.BurstEnabled then
					L_88_ = 3
					L_79_ = false
					L_66_ = L_80_
				elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and not L_24_.BurstEnabled then
					L_88_ = 4
					L_79_ = false
					L_66_ = L_80_
				end
			elseif L_88_ == 6 then
				if Shooting then
					Shooting = false
				end
				L_81_ = L_66_
				if L_24_.SemiEnabled then
					L_88_ = 1
					L_79_ = false
					L_66_ = L_80_
				elseif not L_24_.SemiEnabled and L_24_.AutoEnabled then
					L_88_ = 2
					L_79_ = false
					L_66_ = L_80_
				elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and L_24_.BurstEnabled then
					L_88_ = 3
					L_79_ = false
					L_66_ = L_80_
				elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and not L_24_.BurstEnabled and L_24_.BoltAction then
					L_88_ = 4
					L_79_ = false
					L_66_ = L_80_
				elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and not L_24_.BurstEnabled and not L_24_.BoltAction then
					L_88_ = 6
					L_79_ = true
					L_80_ = L_66_
					L_66_ = L_81_
				end
			end
			UpdateAmmo()
			FireModeAnim()
			IdleAnim()
			L_67_ = false
		end;
		
		if L_303_arg1.KeyCode == Enum.KeyCode.F or L_303_arg1.KeyCode == Enum.KeyCode.DPadDown and not L_74_ and not L_75_ and not L_64_ and not L_67_ and not L_61_ and not L_63_ and not Shooting and not L_73_ then			
			if not L_70_ and not L_71_ then
				L_71_ = true
				Shooting = false
				L_66_ = false
				L_128_ = time()
				delay(0.6, function()
					if L_97_ ~= L_24_.Ammo and L_97_ > 0 then
						CreateShell()
					end
				end)	
				BoltBackAnim()
				L_70_ = true
			elseif L_70_ and L_71_ then
				BoltForwardAnim()
				Shooting = false
				L_66_ = true
				if L_97_ ~= L_24_.Ammo and L_97_ > 0 then
					L_97_ = L_97_ - 1
				elseif L_97_ >= L_24_.Ammo then
					L_66_ = true
				end						
				L_70_ = false
				L_71_ = false
				IdleAnim()
				L_72_ = false
			end
			UpdateAmmo()
		end;
		
		if L_303_arg1.KeyCode == Enum.KeyCode.LeftShift or L_303_arg1.KeyCode == Enum.KeyCode.ButtonL3 and not L_75_ and not L_74_ and L_139_ and not L_61_ then
			L_68_ = true
			if L_15_ and not L_67_ and not L_64_ and L_68_ and not L_62_ and not L_71_ then
				Shooting = false
				L_61_ = false
				L_64_ = true
						
				delay(0, function()
					if L_64_ and not L_63_ then
						L_61_ = false
						L_69_ = true
					end
				end)
				L_93_ = 80
				L_3_.Humanoid.WalkSpeed = L_24_.SprintSpeed
				L_148_ = L_24_.SprintSpeed
				L_147_ = 0.4
			end
		end;
		
		if L_303_arg1.KeyCode == Enum.KeyCode.R or L_303_arg1.KeyCode == Enum.KeyCode.ButtonX and not L_75_ and not L_74_ and L_15_ and not L_63_ and not L_61_ and not Shooting and not L_64_ and not L_71_ then		
			if not L_79_ then			
				if L_98_ > 0 and L_97_ < L_24_.Ammo then
					Shooting = false
					L_63_ = true
					ReloadAnim()
					if L_97_ <= 0 then
						if not L_24_.CanSlideLock then
							BoltBackAnim()
							BoltForwardAnim()
						end
					end
					IdleAnim()
					L_66_ = true
					
					if L_97_ <= 0 then
						if (L_98_ - (L_24_.Ammo - L_97_)) < 0 then
							L_97_ = L_97_ + L_98_
							L_98_ = 0
						else
							L_98_ = L_98_ - (L_24_.Ammo - L_97_)
							L_97_ = L_24_.Ammo
						end
					elseif L_97_ > 0 then
						if (L_98_ - (L_24_.Ammo - L_97_)) < 0 then
							L_97_ = L_97_ + L_98_ + 1
							L_98_ = 0
						else
							L_98_ = L_98_ - (L_24_.Ammo - L_97_)
							L_97_ = L_24_.Ammo + 1
						end
					end
	
					L_63_ = false
					if not L_72_ then
						L_66_ = true
					end
				end;
			elseif L_79_ then
				if L_99_ > 0 then
					Shooting = false
					L_63_ = true
					nadeReload()
					IdleAnim()
					L_63_ = false
					L_66_ = true
				end
			end;
			UpdateAmmo()
		end;
		
		if L_303_arg1.KeyCode == Enum.KeyCode.RightBracket and L_61_ then
			if (L_51_ < 1) then
				L_51_ = L_51_ + L_24_.SensitivityIncrement
			end
		end
		
		if L_303_arg1.KeyCode == Enum.KeyCode.LeftBracket and L_61_ then
			if (L_51_ > 0.1) then
				L_51_ = L_51_ - L_24_.SensitivityIncrement
			end
		end
		
		if L_303_arg1.KeyCode == Enum.KeyCode.T or L_303_arg1.KeyCode == Enum.KeyCode.DPadLeft and L_1_:FindFirstChild("AimPart2") then
			if not L_82_ then
				L_53_ = L_1_:WaitForChild("AimPart2")
				L_50_ = L_24_.CycleAimZoom
				if L_61_ then
					L_93_ = L_24_.CycleAimZoom
				end
				L_82_ = true
			else
				L_53_ = L_1_:FindFirstChild("AimPart")
				L_50_ = L_24_.AimZoom
				if L_61_ then
					L_93_ = L_24_.AimZoom
				end
				L_82_ = false
			end;
		end;
		
		if L_303_arg1.KeyCode == L_24_.InspectionKey and not L_75_ then
			if not L_74_ then
				L_74_ = true
				InspectAnim()
				IdleAnim()
				L_74_ = false
			end
		end;
		
		if L_303_arg1.KeyCode == L_24_.AttachmentKey and not L_74_ then
			if L_15_ then
				if not L_75_ then
					L_64_ = false
					L_61_ = false
					L_66_ = false
					L_75_ = true
					
					AttachAnim()
				elseif L_75_ then
					L_64_ = false
					L_61_ = false
					L_66_ = true
					L_75_ = false
					
					IdleAnim()
				end
			end
		end;
	end
end)

L_101_.InputEnded:connect(function(L_308_arg1, L_309_arg2)
	if not L_309_arg2 and L_15_ then
		if L_308_arg1.UserInputType == Enum.UserInputType.MouseButton2 or L_308_arg1.KeyCode == Enum.KeyCode.ButtonL2 and not L_74_ and L_24_.CanAim and not L_75_ then
			if L_61_ then
				if not L_62_ then
					L_3_.Humanoid.WalkSpeed = 16
					L_148_ = 17
					L_147_ = .25
				end	
				L_93_ = 70
				L_126_.target = Vector3.new()
				L_109_:FireServer(false)
				L_61_ = false
			end
		end;
		
		if L_308_arg1.KeyCode == Enum.KeyCode.E and L_15_ and L_76_ then
			Unlean()		
			L_76_ = false
			L_78_ = false
			L_77_ = false
		end
		
		if L_308_arg1.KeyCode == Enum.KeyCode.Q and L_15_ and L_76_ then
			Unlean()		
			L_76_ = false
			L_78_ = false
			L_77_ = false
		end
		
		if L_308_arg1.KeyCode == L_24_.AlternateAimKey and not L_74_ and L_24_.CanAim then
			if L_61_ then
				if not L_62_ then
					L_3_.Humanoid.WalkSpeed = 16
					L_148_ = 17
					L_147_ = .25
				end	
				L_93_ = 70
				L_126_.target = Vector3.new()
				L_109_:FireServer(false)
				L_61_ = false
			end
		end;
		
		if L_308_arg1.UserInputType == Enum.UserInputType.MouseButton1 or L_308_arg1.KeyCode == Enum.KeyCode.ButtonR2 and not L_74_ then
			L_65_ = false				
			if Shooting then
				Shooting = false
			end
		end;
		
		if L_308_arg1.KeyCode == Enum.KeyCode.E and L_15_ then
			local L_310_ = L_42_:WaitForChild('GameGui')
			if L_16_ then
				L_310_:WaitForChild('AmmoFrame').Visible = false
				L_16_ = false
			end
		end;
		
		if L_308_arg1.KeyCode == Enum.KeyCode.LeftShift or L_308_arg1.KeyCode == Enum.KeyCode.ButtonL3 and not L_74_ and not L_67_ and not L_62_ then -- SPRINT
			L_68_ = false
			if L_64_ and not L_61_ and not Shooting and not L_68_ then
				L_64_ = false
				L_69_ = false
				L_93_ = 70
			
				L_3_.Humanoid.WalkSpeed = 16	
				L_148_ = 17
				L_147_ = .25			
			end
		end;
	end
end)

L_101_.InputChanged:connect(function(L_311_arg1, L_312_arg2)
	if not L_312_arg2 and L_15_ and L_24_.FirstPersonOnly and L_61_ then
		if L_311_arg1.UserInputType == Enum.UserInputType.MouseWheel then
			if L_311_arg1.Position.Z == 1 and (L_51_ < 1) then
				L_51_ = L_51_ + L_24_.SensitivityIncrement
			elseif L_311_arg1.Position.Z == -1 and (L_51_ > 0.1) then
				L_51_ = L_51_ - L_24_.SensitivityIncrement
			end
		end
	end
end)

L_101_.InputChanged:connect(function(L_313_arg1, L_314_arg2)
	if not L_314_arg2 and L_15_ then
		local L_315_, L_316_ = workspace:FindPartOnRayWithIgnoreList(Ray.new(L_53_.CFrame.p, (L_53_.CFrame.lookVector).unit * 10000), IgnoreList);
		if L_315_ then
			local L_317_ = (L_316_ - L_6_.Position).magnitude
			L_33_.Text = math.ceil(L_317_) .. ' m'
		end
	end
end)