Prompt: --// Input Connections

Response:
L_107_.InputBegan:connect(function(L_314_arg1, L_315_arg2)
	if not L_315_arg2 and L_15_ then
		if L_314_arg1.UserInputType == (Enum.UserInputType.MouseButton2 or L_314_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
					if L_24_.TacticalModeEnabled then
						L_154_ = 0.015
						L_155_ = 7
						L_3_:WaitForChild("Humanoid").WalkSpeed = 7
					else
						L_155_ = 10
						L_154_ = 0.008
						L_3_:WaitForChild("Humanoid").WalkSpeed = 10
					end

				end

				if (L_3_.Head.Position - L_5_.CoordinateFrame.p).magnitude <= 2 then
					L_97_ = L_50_
				end
				L_133_.target = L_56_.CFrame:toObjectSpace(L_44_.CFrame).p
				L_115_:FireServer(true)
				L_64_ = true
			end
		end;

		if L_314_arg1.KeyCode == Enum.KeyCode.A and L_15_ then
			L_134_ = CFrame.Angles(0, 0, 0.1)
		end;

		if L_314_arg1.KeyCode == Enum.KeyCode.D and L_15_ then
			L_134_ = CFrame.Angles(0, 0, -0.1)
		end;

		if L_314_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_314_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_314_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_155_ = 10
					L_154_ = 0.008
				end
				L_97_ = L_50_
				L_133_.target = L_56_.CFrame:toObjectSpace(L_44_.CFrame).p
				L_115_:FireServer(true)
				L_64_ = true
			end
		end;

		if L_314_arg1.UserInputType == (Enum.UserInputType.MouseButton1 or L_314_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_103_ > 0 then
					Shoot()
				end
			elseif not Shooting and L_15_ and L_83_ then
				if L_105_ > 0 then
					Shoot()
				end
			end
		end;

		if L_314_arg1.KeyCode == (L_24_.LaserKey or L_314_arg1.KeyCode == Enum.KeyCode.DPadRight) and L_15_ and L_24_.LaserAttached then
			local L_316_ = L_1_:FindFirstChild("LaserLight")
			L_122_.KeyDown[1].Plugin()
		end;

		if L_314_arg1.KeyCode == (L_24_.LightKey or L_314_arg1.KeyCode == Enum.KeyCode.ButtonR3) and L_15_ and L_24_.LightAttached then
			local L_317_ = L_1_:FindFirstChild("FlashLight"):FindFirstChild('Light')
			local L_318_ = false
			L_317_.Enabled = not L_317_.Enabled
		end;

		if L_15_ and L_314_arg1.KeyCode == (L_24_.FireSelectKey or L_314_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_314_arg1.KeyCode == (Enum.KeyCode.F or L_314_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_135_ = time()
				delay(0.6, function()
					if L_103_ ~= L_24_.Ammo and L_103_ > 0 then
						CreateShell()
					end
				end)
				BoltBackAnim()
				L_73_ = true
			elseif L_73_ and L_74_ then
				BoltForwardAnim()
				Shooting = false
				L_69_ = true
				if L_103_ ~= L_24_.Ammo and L_103_ > 0 then
					L_103_ = L_103_ - 1
				elseif L_103_ >= L_24_.Ammo then
					L_69_ = true
				end
				L_73_ = false
				L_74_ = false
				IdleAnim()
				L_75_ = false
			end
			UpdateAmmo()
		end;

		if L_314_arg1.KeyCode == (Enum.KeyCode.LeftShift or L_314_arg1.KeyCode == Enum.KeyCode.ButtonL3) and not L_78_ and not L_77_ and L_146_ 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
				if L_24_.TacticalModeEnabled then
					L_154_ = 0.4
					L_155_ = 16
				else
					L_155_ = L_24_.SprintSpeed
					L_154_ = 0.4
				end
				L_3_.Humanoid.WalkSpeed = L_24_.SprintSpeed
			end
		end;

		if L_314_arg1.KeyCode == (Enum.KeyCode.R or L_314_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_104_ > 0 and L_103_ < L_24_.Ammo then
					Shooting = false
					L_66_ = true

					for L_319_forvar1, L_320_forvar2 in pairs(game.Players:GetChildren()) do
						if L_320_forvar2 and L_320_forvar2:IsA('Player') and L_320_forvar2 ~= L_2_ and L_320_forvar2.TeamColor == L_2_.TeamColor then
							if (L_320_forvar2.Character.HumanoidRootPart.Position - L_3_.HumanoidRootPart.Position).magnitude  <= 150 then
								if L_7_:FindFirstChild('AHH') and not L_7_.AHH.IsPlaying then
									L_119_:FireServer(L_7_.AHH, L_100_[math.random(0, 23)])
								end
							end
						end
					end

					if L_103_ <= 1 then
						if not L_24_.CanSlideLock then
							ReloadAnim()
						end
					end
					if L_103_ <= 2 then
						if not L_24_.CanSlideLock then
							ReloadAnim()
						end
					end
					if L_103_ <= 3 then
						if not L_24_.CanSlideLock then
							ReloadAnim()
						end
					end
					if L_103_ <= 4 then
						if not L_24_.CanSlideLock then
							ReloadAnim()
						end
					end
					if L_103_ <= 5 then
						if not L_24_.CanSlideLock then
							ReloadAnim()
						end
					end
					if L_103_ <= 6 then
						if not L_24_.CanSlideLock then
							ReloadAnim()
						end
					end
					if L_103_ <= 7 then
						if not L_24_.CanSlideLock then
							ReloadAnim()
						end
					end
					if L_103_ >= 0 then
						if not L_24_.CanSlideLock then
							ReloadAnim()
						end
					end
					if L_103_ <= 0 then
						if not L_24_.CanSlideLock then
							BoltBackAnim()
							BoltForwardAnim()
						end
					end

					IdleAnim()
					L_69_ = true

					if L_103_ <= 0 then
						if (L_104_ - (L_24_.Ammo - L_103_)) < 0 then
							L_103_ = L_103_ + L_104_
							L_104_ = 0
						else
							L_104_ = L_104_ - (L_24_.Ammo - L_103_)
							L_103_ = L_24_.Ammo
						end
					elseif L_103_ > 0 then
						if (L_104_ - (L_24_.Ammo - L_103_)) < 0 then
							L_103_ = L_103_ + L_104_ + 1
							L_104_ = 0
						else
							L_104_ = L_104_ - (L_24_.Ammo - L_103_)
							L_103_ = 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_105_ > 0 then
					Shooting = false
					L_66_ = true
					nadeReload()
					IdleAnim()
					L_66_ = false
					L_69_ = true
				end
			end;
			UpdateAmmo()
		end;

		if L_314_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_314_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_314_arg1.KeyCode == (Enum.KeyCode.T or L_314_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_314_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_314_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_314_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_112_: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_112_:FireServer("Unpatrol")
			end
		end;
	end
end)

L_107_.InputEnded:connect(function(L_321_arg1, L_322_arg2)
	if not L_322_arg2 and L_15_ then
		if L_321_arg1.UserInputType == (Enum.UserInputType.MouseButton2 or L_321_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
					if L_24_.TacticalModeEnabled then
						L_154_ = 0.09
						L_155_ = 11
					else
						L_154_ = .2
						L_155_ = 17
					end
				end
				L_97_ = 70
				L_133_.target = Vector3.new()
				L_115_:FireServer(false)
				L_64_ = false
			end
		end;

		if L_321_arg1.KeyCode == Enum.KeyCode.A and L_15_ then
			L_134_ = CFrame.Angles(0, 0, 0)
		end;

		if L_321_arg1.KeyCode == Enum.KeyCode.D and L_15_ then
			L_134_ = CFrame.Angles(0, 0, 0)
		end;

		if L_321_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_321_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_321_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_155_ = 17
					L_154_ = .25
				end
				L_97_ = 70
				L_133_.target = Vector3.new()
				L_115_:FireServer(false)
				L_64_ = false
			end
		end;

		if L_321_arg1.UserInputType == (Enum.UserInputType.MouseButton1 or L_321_arg1.KeyCode == Enum.KeyCode.ButtonR2) and not L_77_ then
			L_68_ = false
			if Shooting then
				Shooting = false
			end
		end;

		if L_321_arg1.KeyCode == Enum.KeyCode.E and L_15_ then
			local L_323_ = L_42_:WaitForChild('GameGui')
			if L_16_ then
				L_323_:WaitForChild('AmmoFrame').Visible = false
				L_16_ = false
			end
		end;

		if L_321_arg1.KeyCode == (Enum.KeyCode.LeftShift or L_321_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
				if L_24_.TacticalModeEnabled then
					L_154_ = 0.09
					L_155_ = 11
				else
					L_154_ = .2
					L_155_ = 17
				end
			end
		end;
	end
end)

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

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


Prompt:
---------------------------
--[[
	--Main anchor point is the DriveSeat <car.DriveSeat>

	Usage:
		MakeWeld(Part1,Part2,WeldType*,MotorVelocity**) *default is "Weld"  **Applies to Motor welds only
		ModelWeld(Model,MainPart)
	Example:
		MakeWeld(car.DriveSeat,misc.PassengerSeat)
		MakeWeld(car.DriveSeat,misc.SteeringWheel,"Motor",.2)
		ModelWeld(car.DriveSeat,misc.Door)
]]


Prompt: -- Create scope HUD when tool opens

Response:
coroutine.wrap(function ()
	Enabled:Wait()

	-- Create scope HUD
	local ScopeHUDTemplate = require(UIElements:WaitForChild 'ScopeHUD')
	local ScopeHUD = Roact.createElement(ScopeHUDTemplate, {
		Core = getfenv(0);
	})

	-- Mount scope HUD
	Roact.mount(ScopeHUD, UI, 'ScopeHUD')
end)()


Prompt: --[[Engine]]

Response:
	--Torque Curve
	Tune.Horsepower		= 180		--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 700		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 6000		--		Use sliders to manipulate values
	Tune.Redline		= 6700		--		Copy and paste slider values into the respective tune values
	Tune.EqPoint		= 5500
	Tune.PeakSharpness	= 7.5
	Tune.CurveMult		= 0.16

	--Incline Compensation
	Tune.InclineComp	= 1.7			-- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)

	--Misc
	Tune.RevAccel		= 150		-- RPM acceleration when clutch is off
	Tune.RevDecay		= 75		-- RPM decay when clutch is off
	Tune.RevBounce		= 500		-- RPM kickback from redline
	Tune.IdleThrottle	= 3			-- Percent throttle at idle
	Tune.ClutchTol		= 500		-- Clutch engagement threshold (higher = faster response)


Prompt:
---- Public Functions
-- Set

Response:
function StringLabel:SetText(text)
	waitForUpdate(self)

	self._textLabel.Text = text
end

function StringLabel:SetSize(size)
	waitForUpdate(self)

	self._textLabel.Size = size
end

function StringLabel:SetPosition(position)
	waitForUpdate(self)

	self._textLabel.Position = position
end

function StringLabel:SetFont(font)
	waitForUpdate(self)

	for _, label in pairs(self._characterLabels) do
		label.Font = font
	end
end

function StringLabel:SetTextColor(color)
	waitForUpdate(self)

	for _, label in pairs(self._characterLabels) do
		label.TextColor3 = color
	end
end

function StringLabel:SetTextTransparency(transparency)
	waitForUpdate(self)

	for _, label in pairs(self._characterLabels) do
		label.TextTransparency = transparency
	end
end

function StringLabel:SetRotation(rotation)
	waitForUpdate(self)

	for _, label in pairs(self._characterLabels) do
		label.Rotation = rotation
	end
end

function StringLabel:SetCharacterFont(index, font)
	waitForUpdate(self)

	local label = self._characterLabels[index]
	if label then
		label.Font = font
	end
end

function StringLabel:SetCharacterTextColor(index, color)
	waitForUpdate(self)

	local label = self._characterLabels[index]
	if label then
		label.TextColor3 = color
	end
end

function StringLabel:SetCharacterTextTransparency(index, transparency)
	waitForUpdate(self)

	local label = self._characterLabels[index]
	if label then
		label.TextTransparency = transparency
	end
end

function StringLabel:SetCharacterRotation(index, rotation)
	waitForUpdate(self)

	local label = self._characterLabels[index]
	if label then
		label.Rotation = rotation
	end
end


Prompt: -- Make the ScrollingFrame, which holds the rest of the Slots (however many)

Response:
ScrollingFrame = NewGui('ScrollingFrame', 'ScrollingFrame')
ScrollingFrame.Selectable = false
ScrollingFrame.CanvasSize = UDim2.new(0, 0, 0, 0)
ScrollingFrame.Parent = InventoryFrame

UIGridFrame = NewGui('Frame', 'UIGridFrame')
UIGridFrame.Selectable = false
UIGridFrame.Size = UDim2.new(1, -(ICON_BUFFER*2), 1, 0)
UIGridFrame.Position = UDim2.new(0, ICON_BUFFER, 0, 0)
UIGridFrame.Parent = ScrollingFrame

UIGridLayout = Instance.new("UIGridLayout")
UIGridLayout.SortOrder = Enum.SortOrder.LayoutOrder
UIGridLayout.CellSize = UDim2.new(0, ICON_SIZE, 0, ICON_SIZE)
UIGridLayout.CellPadding = UDim2.new(0, ICON_BUFFER, 0, ICON_BUFFER)
UIGridLayout.Parent = UIGridFrame

ScrollUpInventoryButton = MakeVRRoundButton('ScrollUpButton', 'rbxasset://textures/ui/Backpack/ScrollUpArrow.png')
ScrollUpInventoryButton.Size = UDim2.new(0, 34, 0, 34)
ScrollUpInventoryButton.Position = UDim2.new(0.5, -ScrollUpInventoryButton.Size.X.Offset/2, 0, INVENTORY_HEADER_SIZE + 3)
ScrollUpInventoryButton.Icon.Position = ScrollUpInventoryButton.Icon.Position - UDim2.new(0,0,0,2)
ScrollUpInventoryButton.MouseButton1Click:Connect(function()
	ScrollingFrame.CanvasPosition = Vector2.new(
		ScrollingFrame.CanvasPosition.X,
		Clamp(0, ScrollingFrame.CanvasSize.Y.Offset - ScrollingFrame.AbsoluteWindowSize.Y, ScrollingFrame.CanvasPosition.Y - (ICON_BUFFER + ICON_SIZE)))
end)

ScrollDownInventoryButton = MakeVRRoundButton('ScrollDownButton', 'rbxasset://textures/ui/Backpack/ScrollUpArrow.png')
ScrollDownInventoryButton.Rotation = 180
ScrollDownInventoryButton.Icon.Position = ScrollDownInventoryButton.Icon.Position - UDim2.new(0,0,0,2)
ScrollDownInventoryButton.Size = UDim2.new(0, 34, 0, 34)
ScrollDownInventoryButton.Position = UDim2.new(0.5, -ScrollDownInventoryButton.Size.X.Offset/2, 1, -ScrollDownInventoryButton.Size.Y.Offset - 3)
ScrollDownInventoryButton.MouseButton1Click:Connect(function()
	ScrollingFrame.CanvasPosition = Vector2.new(
		ScrollingFrame.CanvasPosition.X,
		Clamp(0, ScrollingFrame.CanvasSize.Y.Offset - ScrollingFrame.AbsoluteWindowSize.Y, ScrollingFrame.CanvasPosition.Y + (ICON_BUFFER + ICON_SIZE)))
end)

ScrollingFrame.Changed:Connect(function(prop)
	if prop == 'AbsoluteWindowSize' or prop == 'CanvasPosition' or prop == 'CanvasSize' then
		local canScrollUp = ScrollingFrame.CanvasPosition.Y ~= 0
		local canScrollDown = ScrollingFrame.CanvasPosition.Y < ScrollingFrame.CanvasSize.Y.Offset - ScrollingFrame.AbsoluteWindowSize.Y

		ScrollUpInventoryButton.Visible = canScrollUp
		ScrollDownInventoryButton.Visible = canScrollDown
	end
end)


Prompt: -- Hot water

Response:
faucet.HotWaterSet.Interactive.ClickDetector.MouseClick:Connect(function()
	faucet.Handle:SetPrimaryPartCFrame(faucet.HandleBase.CFrame * CFrame.Angles(math.rad(-150),0,0))
	p.HotOn.Value = true
	p.ColdOn.Value = false
end)


Prompt:
-- Compare items in two sequences to find a longest common subsequence.
-- Given lengths of sequences and input function to compare items at indexes,
-- return by output function the number of adjacent items and starting indexes
-- of each common subsequence.

Response:
return function(aLength: number, bLength: number, isCommon: IsCommon, foundSubsequence: FoundSubsequence): ()
	validateLength("aLength", aLength)
	validateLength("bLength", bLength)
	validateCallback("isCommon", isCommon)
	validateCallback("foundSubsequence", foundSubsequence)

	-- Count common items from the start in the forward direction.
	local nCommonF = countCommonItemsF(0, aLength, 0, bLength, isCommon)

	if nCommonF ~= 0 then
		foundSubsequence(nCommonF, 0, 0)
	end

	-- Unless both sequences consist of common items only,
	-- find common items in the half-trimmed index intervals.
	if aLength ~= nCommonF or bLength ~= nCommonF then
		-- Invariant: intervals do not have common items at the start.
		-- The start of an index interval is closed like array slice method.
		local aStart = nCommonF
		local bStart = nCommonF

		-- Count common items from the end in the reverse direction.
		local nCommonR = countCommonItemsR(aStart, aLength - 1, bStart, bLength - 1, isCommon)

		-- Invariant: intervals do not have common items at the end.
		-- The end of an index interval is open like array slice method.
		local aEnd = aLength - nCommonR
		local bEnd = bLength - nCommonR

		-- Unless one sequence consists of common items only,
		-- therefore the other trimmed index interval consists of changes only,
		-- find common items in the trimmed index intervals.
		local nCommonFR = nCommonF + nCommonR
		if aLength ~= nCommonFR and bLength ~= nCommonFR then
			local nChange = 0 -- number of change items is not yet known
			local transposed = false -- call the original unwrapped functions
			local callbacks = { { foundSubsequence, isCommon } }

			-- Indexes in sequence a of last points in furthest reaching paths
			-- from outside the start at top left in the forward direction:
			local aIndexesF = { NOT_YET_SET }
			-- from the end at bottom right in the reverse direction:
			local aIndexesR = { NOT_YET_SET }

			-- Initialize one object as output of all calls to divide function.
			local division = {
				aCommonFollowing = NOT_YET_SET,
				aCommonPreceding = NOT_YET_SET,
				aEndPreceding = NOT_YET_SET,
				aStartFollowing = NOT_YET_SET,
				bCommonFollowing = NOT_YET_SET,
				bCommonPreceding = NOT_YET_SET,
				bEndPreceding = NOT_YET_SET,
				bStartFollowing = NOT_YET_SET,
				nChangeFollowing = NOT_YET_SET,
				nChangePreceding = NOT_YET_SET,
				nCommonFollowing = NOT_YET_SET,
				nCommonPreceding = NOT_YET_SET,
			}

			-- Find and return common subsequences in the trimmed index intervals.
			findSubsequences(nChange, aStart, aEnd, bStart, bEnd, transposed, callbacks, aIndexesF, aIndexesR, division)
		end

		if nCommonR ~= 0 then
			foundSubsequence(nCommonR, aEnd, bEnd)
		end
	end
end


Prompt: --valve things

Response:
local BOVsound = car.DriveSeat.BOV
BOVsound.Volume = 0.3 --bov volume
BOVsound.Pitch = 1 -- pitch, i wouldn't change this lol
BOVsound.SoundId = "rbxassetid://337982546" --sound, duh.


Prompt:
--[[if (UserInputService.TouchEnabled) then
	ChatBar:SetTextLabelText(ChatLocalization:Get("GameChat_ChatMain_ChatBarText",'Tap here to chat'))
else
	ChatBar:SetTextLabelText(ChatLocalization:Get("GameChat_ChatMain_ChatBarTextTouch",'To chat click here or press "/" key'))
end]]

Response:
ChatBar:SetTextLabelText(ChatLocalization:Get("GameChat_ChatMain_ChatBarTextTouch",'To chat click here or press "/" key'))

spawn(function()
	local CurveUtil = require(modulesFolder:WaitForChild("CurveUtil"))
	local animationFps = ChatSettings.ChatAnimationFPS or 20.0

	local updateWaitTime = 1.0 / animationFps
	local lastTick = tick()
	while true do
		local currentTick = tick()
		local tickDelta = currentTick - lastTick
		local dtScale = CurveUtil:DeltaTimeToTimescale(tickDelta)

		if dtScale ~= 0 then
			ChatWindow:Update(dtScale)
		end

		lastTick = currentTick
		wait(updateWaitTime)
	end
end)


Prompt:
--[[
    A component that establishes a connection to a Roblox event when it is rendered.
]]

Response:
local Roact = require(script.Parent.Packages.Roact)

local ExternalEventConnection = Roact.Component:extend("ExternalEventConnection")

function ExternalEventConnection:init()
	self.connection = nil
end


Prompt: -- Allow RaycastModule to write to the output

Response: local SHOW_OUTPUT_MESSAGES: boolean = false


Prompt: --this part manages the local script

Response:
local addMyLocalScript = function(player)
	local localScript = script["Chain Coupler Local"]:Clone()
	local backpack = player:WaitForChild("Backpack")
	if not player:WaitForChild("Backpack"):FindFirstChild("Chain Coupler Local") then
		localScript.Parent = player.Backpack
	end
end

local addScriptAtRespawn = function(player)
	player.CharacterAdded:connect(function() addMyLocalScript(player) end)
end


Prompt:
--[[
	Package link auto-generated by Rotriever
]]

Response:
local PackageIndex = script.Parent.Parent.Parent._Index

local Package = require(PackageIndex["JestSnapshot"]["JestSnapshot"])

return Package


Response:
workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
workspace.CurrentCamera.CameraSubject = script.Parent:WaitForChild('Humanoid')

wait()

script:Destroy()


Response:
local function IsDirectionDown(direction)
	for i = 1, #KEY_MAPPINGS[direction] do
		if UIS:IsKeyDown(KEY_MAPPINGS[direction][i]) then
			return true
		end
	end
	return false
end

local UpdateFreecam do
	local dt = 1/60
	RS.RenderStepped:Connect(function(_dt)
		dt = _dt
	end)

	function UpdateFreecam()
		local camCFrame = camera.CFrame

		local kx = (IsDirectionDown(DIRECTION_RIGHT) and 1 or 0) - (IsDirectionDown(DIRECTION_LEFT) and 1 or 0)
		local ky = (IsDirectionDown(DIRECTION_UP) and 1 or 0) - (IsDirectionDown(DIRECTION_DOWN) and 1 or 0)
		local kz = (IsDirectionDown(DIRECTION_BACKWARD) and 1 or 0) - (IsDirectionDown(DIRECTION_FORWARD) and 1 or 0)
		local km = (kx * kx) + (ky * ky) + (kz * kz)
		if km > 1e-15 then
			km = ((UIS:IsKeyDown(Enum.KeyCode.LeftShift) or UIS:IsKeyDown(Enum.KeyCode.RightShift)) and 1/4 or 1)/math.sqrt(km)
			kx = kx * km
			ky = ky * km
			kz = kz * km
		end

		local dx = kx + gp_x
		local dy = ky + gp_r1 - gp_l1
		local dz = kz + gp_z

		velSpring.t = Vector3.new(dx, dy, dz) * SpeedModifier
		rotSpring.t = panDeltaMouse + panDeltaGamepad
		fovSpring.t = Clamp(fovSpring.t + dt * rate_fov*FVEL_GAIN, 5, 120)

		local fov  = fovSpring:Update(dt)
		local dPos = velSpring:Update(dt) * LVEL_GAIN
		local dRot = rotSpring:Update(dt) * (RVEL_GAIN * math.tan(fov * math.pi/360) * NM_ZOOM)

		rate_fov = 0
		panDeltaMouse = Vector2.new()

		stateRot = stateRot + dRot
		stateRot = Vector2.new(Clamp(stateRot.x, -3/2, 3/2), stateRot.y)

		local c = CFrame.new(camCFrame.p) * CFrame.Angles(0, stateRot.y, 0) * CFrame.Angles(stateRot.x, 0, 0) * CFrame.new(dPos)

		camera.CFrame = c
		camera.Focus = c*FOCUS_OFFSET
		camera.FieldOfView = fov
	end
end


Prompt: --the click

Response:
script.Parent.ClickDetector.MouseClick:connect(function(player)
	if ready == true then
		ready = false
		local tool = machine.IceCream:clone()
		local Plate = script.Parent.Parent.Plate
		local handl = script.Parent.Parent.Content.Handle:clone()

		handl.Parent = storage
		tool.Parent =  storage
		handl.Position = Vector3.new(Plate.Position.X,Plate.Position.Y +0.6,Plate.Position.Z)
		machine.Who.Value = player.Name
		machine.Target.Text = ""..player.Name..""
		script.Parent.ClickDetector.MaxActivationDistance = 0
		coverdown()
		menuoneappear()

			for _,one in pairs(machine.ToppingsOne:GetChildren()) do
				if one:IsA("TextButton") then
					one.MouseButton1Down:connect(function()
					local ice = script.Parent.Parent.Ice[one.Name]:clone()
					ice.Parent = tool
					ice.CFrame = CFrame.new(Vector3.new(handl.Position.X+0.025,handl.Position.Y+0.15,handl.Position.Z))
					menuonedisappear()
					menutwoappear()

					for _,two in pairs(machine.ToppingsTwo:GetChildren()) do
						if two:IsA("TextButton") then
							two.MouseButton1Down:connect(function()
							local ice = script.Parent.Parent.Ice[two.Name]:clone()
							ice.Parent = tool
							ice.CFrame = CFrame.new(Vector3.new(handl.Position.X+0.025,handl.Position.Y+0.35,handl.Position.Z))
							menutwodisappear()
							handl.Parent = tool
							tool.Enabled = true
							tool.Weld.Disabled = false
							tool.IceScript.Disabled = false
							tool.Parent = game.Players[machine.Who.Value].Backpack
							for _,parts in pairs(tool:GetChildren()) do
								if parts:IsA("Part") then
								parts.Anchored = false
								end
							end
							wait()
							machine.Who.Value = ""
							machine.Target.Text = ""
							script.Parent.ClickDetector.MaxActivationDistance = 10
							coverup()
							script.Fixer.Disabled = false
						end)
					end
				end
					end)
				end
			end
		wait(5)
	ready = true
	end
end)


Prompt: ------Mood------

Response:
local faces = myHead.Faces
status:set("currentFace",myHead.faceIdle)

local idleIndex = 5
function movementLogic()
	local target = status:get("currentTarget")
	local dist = core.checkDist(target,myRoot)
	local canSee = core.checkSight(target)

	idleIndex -= 1
	if canSee then
		idleIndex = 5 --100
	end
	if ((dist > 50 or not canSee) and (myRoot.Position.Y < target.Position.Y-10 or idleIndex <= 0)) then
		movement.pathToLocation(target)
	elseif (dist > 30 or not canSee) and core.checkPotentialSight(target) then
		myHuman:MoveTo(movement.slowAdvance())
		wait(0.3)
	elseif dist > 50 and dist < 90 and canSee and status:get("m4Equipped") then
		myHuman:MoveTo(movement.strafe())
		wait(0.5)
	elseif dist > 4 and dist < 50 and canSee and math.abs(myRoot.Position.Y - target.Position.Y) < 2 and status:get("weaponAimed") then
		myHuman:MoveTo(movement.retreat())
		wait(0.2)
	elseif (dist < 10 and canSee) or status:get("knifeEquipped") then
		myHuman:MoveTo(movement.retreat())
	end
end

function movementLoop()
	while myHuman.Health>0 do
		if status:get("currentTarget") then
			movementLogic()
		else
			if mySettings.Wander.Value and math.random(4) == 3 then
				movement.walkRandom()
			end
			wait(3)
		end
		wait(0.1)
	end
end

function getIncomingAttackers()

	local targets = {}

	local params = RaycastParams.new()
	params.FilterDescendantsInstances = {marine}
	for i = -20, 20, 2 do
		local origin = myRoot.Position + Vector3.new(-20,0,i)
		local dir = Vector3.new(40,0,0)
		troubleshoot.createBeam(origin,dir)
		local result = workspace:Raycast(origin, dir)
		if result then
			local human = core.getHuman(result.Instance.Parent)
			local root = result.Instance.Parent:FindFirstChild("HumanoidRootPart")
			if human and human.Health>0 and root and not core.isAlly(result.Instance.Parent) then
				if core.checkSight(root) then
					table.insert(targets,root)
				end
			end
		end
	end

	--Sort through targets to target the closest one to us
	local dist = math.huge
	local tempTarget = nil
	for _,potentialTarget in ipairs(targets) do
		if core.checkDist(potentialTarget,myRoot) < dist then
			dist = core.checkDist(potentialTarget,myRoot)
			tempTarget = potentialTarget
		end
	end

	if tempTarget then
		status:set("currentTarget",tempTarget)
	end
end

function searchTargetLoop()
	while myHuman.Health>0 do
		getIncomingAttackers()
		if not status:get("currentTarget") or not status:get("currentTarget").Parent or status:get("currentTarget").Parent.Humanoid.Health <=0 or status:get("tookDamage") then
			status:set("tookDamage",false)
			status:set("currentTarget",nil)
			targeting.findTarget()
		elseif not core.checkSight(status:get("currentTarget")) then
			targeting.findTarget()
			if not status:get("currentTarget") then
				wait(3)
			end
		end
		wait(0.5)
	end
end

function aimingLoop()
	while myHuman.Health>0 do
		if status:get("currentTarget") then
			if core.checkSight(status:get("currentTarget")) and status:get("m4Equipped") then
				actions.aim(status:get("currentTarget"))
			else
				wait(0.5)
			end
		else
			wait(2)
		end
		wait(0.1)
	end
end

function attackLogic()
	actions.updateFace("Attacking")

	local target = status:get("currentTarget")

	local distance = core.checkDist(myRoot,target)
	if distance > 7 then

		--If there is a cluster of enemies far enough away throw grenade.
		if combat.checkCluster(target) and distance < 100 and distance > 40 and status:get("grenadeCool") then
			combat.shoot(target)
		elseif status:get("m4Equipped") then
			if core.facingTarget() and core.checkShot(target) then
				combat.shoot(target)
			end
		else
			actions.drawM4()
		end
	else
	end
end

function attackLoop()
	while myHuman.Health>0 do

		local target = status:get("currentTarget")

		if target and target.Parent then
			actions.updateFace("Hunting")

			--If we have a target we can see
			if core.checkSight(status:get("currentTarget")) and core.checkDist(myRoot,target) < mySettings.M4.Range.Value then
				attackLogic()
			elseif status:get("m4Equipped") and not status:get("weaponAimed") then
				status:set("weaponAimed",false)
				actions.lowerM4()
			end
		else
			actions.updateFace("Idle")
			actions.yieldWeapons()
			wait(2)
		end
		wait(0.1)
	end
end

core.spawn(searchTargetLoop)
core.spawn(attackLoop)
core.spawn(movementLoop)
core.spawn(aimingLoop)


Prompt:
---WeldConstraint anything you want to move to the TargetL_Closed and TargetR_Closed MeshParts.
---TargetL_Closed and TargetR_Closed should be anchored but child welded objects that move with TargetL_Closed and TargetR_Closed should not be anchored.
---You may move, rotate and scale the Targets but for a simple door only translation is used.
---IntValue Speed controls the doors speed to open and close.
---After you have finished creating your door turn the transparency of Trigger, TargetL_Closed, TargetL_Open, TargetR_Closed and TargetR_Open to 1 or fully transparent.

Response:
local TweenService = game:GetService("TweenService")

local model = script.Parent
local sound = model.Sound.Value
local trigger = model.Trigger

local left = model.TargetL_Closed
local right = model.TargetR_Closed

local tweenInfo = TweenInfo.new (
	model.Speed.Value, --Time/Speed of Door Tween
	Enum.EasingStyle.Quart,  --Easing Style
	Enum.EasingDirection.InOut, --EasingDirection
	0, --Repeat Count
	false, --Reverse true
	0 --Delay
)

local DoorState = {
	["Closed"] = 1,
	["Opening"] = 2,
	["Open"] = 3,
	["Closing"] = 4,
}

local doorState = DoorState.Closed
local playersNear = {}

local tweenL = TweenService:Create(left, tweenInfo, {CFrame = model.TargetL_Open.CFrame})
local tweenR = TweenService:Create(right, tweenInfo, {CFrame = model.TargetR_Open.CFrame})

local tweenLClose = TweenService:Create(left, tweenInfo, {CFrame = model.TargetL_Closed.CFrame})
local tweenRClose = TweenService:Create(right, tweenInfo, {CFrame = model.TargetR_Closed.CFrame})

local function StartOpening()
	doorState = DoorState.Opening
	sound:Play()

	tweenL:Play()
	tweenR:Play()
end

local function StartClosing()
	doorState = DoorState.Closing
	--model["Door"]:Play()

	tweenLClose:Play()
	tweenRClose:Play()
end

local function tweenOpenCompleted(playbackState)
	if(next(playersNear) == nil) then
		StartClosing()
	else
		doorState = DoorState.Open
	end
end

local function tweenCloseCompleted(playbackState)
	if(next(playersNear) ~= nil) then
		StartOpening()
	else
		doorState = DoorState.Closed
	end
end

tweenL.Completed:Connect(tweenOpenCompleted)
tweenLClose.Completed:Connect(tweenCloseCompleted)

local function touched(otherPart)
	if(otherPart.Name == "HumanoidRootPart" ) then
		local player = game.Players:FindFirstChild(otherPart.Parent.Name)
		if(player) then
			--print("touch")
			playersNear[player] = 1
			if(doorState == DoorState.Closed) then
				StartOpening()
			end
		end
	end
end


Prompt: -- (Hat Giver Script - Loaded.)

Response:
debounce = true

function onTouched(hit)
	if (hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == true) then
		debounce = false
		h = Instance.new("Hat")
		p = Instance.new("Part")
		h.Name = "HivemindFabrege"
		p.Parent = h
		p.Position = hit.Parent:findFirstChild("Head").Position
		p.Name = "Handle"
		p.formFactor = 0
		p.Size = Vector3.new(2, 1, 1)
		p.BottomSurface = 0
		p.TopSurface = 0
		p.Locked = true
		script.Parent.Mesh:clone().Parent = p
		h.Parent = hit.Parent
		h.AttachmentPos = Vector3.new(0, -1.125, 0)
		wait(5)
		debounce = true
	end
end

script.Parent.Touched:connect(onTouched)


Prompt: -- Keyboard controller is really keyboard and mouse controller

Response:
local computerInputTypeToModuleMap = {
	[Enum.UserInputType.Keyboard] = Keyboard,
	[Enum.UserInputType.MouseButton1] = Keyboard,
	[Enum.UserInputType.MouseButton2] = Keyboard,
	[Enum.UserInputType.MouseButton3] = Keyboard,
	[Enum.UserInputType.MouseWheel] = Keyboard,
	[Enum.UserInputType.MouseMovement] = Keyboard,
	[Enum.UserInputType.Gamepad1] = Gamepad,
	[Enum.UserInputType.Gamepad2] = Gamepad,
	[Enum.UserInputType.Gamepad3] = Gamepad,
	[Enum.UserInputType.Gamepad4] = Gamepad,
}

local lastInputType

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

	-- The Modules above are used to construct controller instances as-needed, and this
	-- table is a map from Module to the instance created from it
	self.controllers = {}

	self.activeControlModule = nil	-- Used to prevent unnecessarily expensive checks on each input event
	self.activeController = nil
	self.touchJumpController = nil
	self.moveFunction = Players.LocalPlayer.Move
	self.humanoid = nil
	self.lastInputType = Enum.UserInputType.None

	-- For Roblox self.vehicleController
	self.humanoidSeatedConn = nil
	self.vehicleController = nil

	self.touchControlFrame = nil

	self.vehicleController = VehicleController.new(CONTROL_ACTION_PRIORITY)

	Players.LocalPlayer.CharacterAdded:Connect(function(char) self:OnCharacterAdded(char) end)
	Players.LocalPlayer.CharacterRemoving:Connect(function(char) self:OnCharacterRemoving(char) end)
	if Players.LocalPlayer.Character then
		self:OnCharacterAdded(Players.LocalPlayer.Character)
	end

	RunService:BindToRenderStep("ControlScriptRenderstep", Enum.RenderPriority.Input.Value, function(dt)
		self:OnRenderStepped(dt)
	end)

	UserInputService.LastInputTypeChanged:Connect(function(newLastInputType)
		self:OnLastInputTypeChanged(newLastInputType)
	end)

	UserGameSettings:GetPropertyChangedSignal("TouchMovementMode"):Connect(function()
		self:OnTouchMovementModeChange()
	end)
	Players.LocalPlayer:GetPropertyChangedSignal("DevTouchMovementMode"):Connect(function()
		self:OnTouchMovementModeChange()
	end)

	UserGameSettings:GetPropertyChangedSignal("ComputerMovementMode"):Connect(function()
		self:OnComputerMovementModeChange()
	end)
	Players.LocalPlayer:GetPropertyChangedSignal("DevComputerMovementMode"):Connect(function()
		self:OnComputerMovementModeChange()
	end)

	--[[ Touch Device UI ]]--
	self.playerGui = nil
	self.touchGui = nil
	self.playerGuiAddedConn = nil

	if UserInputService.TouchEnabled then
		self.playerGui = Players.LocalPlayer:FindFirstChildOfClass("PlayerGui")
		if self.playerGui then
			self:CreateTouchGuiContainer()
			self:OnLastInputTypeChanged(UserInputService:GetLastInputType())
		else
			self.playerGuiAddedConn = Players.LocalPlayer.ChildAdded:Connect(function(child)
				if child:IsA("PlayerGui") then
					self.playerGui = child
					self:CreateTouchGuiContainer()
					self.playerGuiAddedConn:Disconnect()
					self.playerGuiAddedConn = nil
					self:OnLastInputTypeChanged(UserInputService:GetLastInputType())
				end
			end)
		end
	else
		self:OnLastInputTypeChanged(UserInputService:GetLastInputType())
	end

	return self
end


Prompt: --// States

Response:
local L_60_ = false
local L_61_ = false
local L_62_ = false
local L_63_ = false
local L_64_ = false
local L_65_ = true
local L_66_ = false
local L_67_ = false
local L_68_ = false
local L_69_ = false
local L_70_ = false
local L_71_ = false
local L_72_ = false
local L_73_ = false

local L_74_ = false
local L_75_ = false
local L_76_ = false

local L_77_ = false
local L_78_ = true
local L_79_ = true

local L_80_ = false

local L_81_
local L_82_

local L_83_
local L_84_
local L_85_

local L_86_ = L_24_.FireMode

local L_87_ = 0
local L_88_ = false
local L_89_ = true
local L_90_ = false

local L_91_ = 70


Prompt: -- инициализируем подключение

Response:
local DataStore2 = require(1936396537) -- вариант подключаемого модуля

local function processReceipt(ReceiptInfo)
	local player = game:GetService("Players"):GetPlayerByUserId(ReceiptInfo.PlayerId) -- получаем Id игрока

	if not player then -- если не игрок, то вылетаем
		return Enum.ProductPurchaseDecision.NotProcessedYet
	end

	-- если игрок найден, выполняем действия
	-- print(ReceiptInfo.PlayerId .. " buy " .. ReceiptInfo.ProductId)
	-- local moneyStore = DataStore2("money", player)
	-- moneyStore:Increment(1000) -- даём 100 монет
	local char=player.Character
	if player:FindFirstChild("Buy") == nil then -- проверяем наличие переменной, если нет - создаём
		local Buy = Instance.new("IntValue")
		Buy.Parent = player
		Buy.Name = "Buy"
		Buy.Value=3
	else
		player.Buy.Value = 3
	end
	char.Humanoid.WalkSpeed = 30
	-- а теперь убираем Frame покупки
	local pl = game.Players:FindFirstChild(player.Name)
	if pl ~= nil then
		pl.PlayerGui.Main.GameDev.Visible=false
		pl.PlayerGui.Main.Answer.Visible=true
	end

	-- возвращаем, что покупка произведена
	return Enum.ProductPurchaseDecision.PurchaseGranted

end

MS.ProcessReceipt= processReceipt


Prompt: -- Overrides Keyboard:UpdateMovement(inputState) to conditionally consider self.wasdEnabled and let OnRenderStepped handle the movement

Response:
function ClickToMove:UpdateMovement(inputState)
	if inputState == Enum.UserInputState.Cancel then
		self.keyboardMoveVector = ZERO_VECTOR3
	elseif self.wasdEnabled then
		self.keyboardMoveVector = Vector3.new(self.leftValue + self.rightValue, 0, self.forwardValue + self.backwardValue)
	end
end


Prompt: --[[ Imports ]]

Response: local CameraUtils = require(script.Parent:WaitForChild("CameraUtils"))


Prompt:
--ball.SparkSound.Looped = false
--ball.SparkSound:Stop()

Response: ball.Parent = nil


Prompt: --Notes--

Response:
local function AttachParticleControl(source_part)

	local prtc = nil

	local function Start()
		prtc = script.Notes:clone()
		prtc.Parent = source_part
	end

	local function Update()

	end

	local function Stop()
		if prtc ~= nil then
			prtc:destroy()
			prtc = nil
		end
	end

	return {Start = Start, Update = Update, Stop = Stop}
end

return AttachParticleControl


Prompt:
---WeldConstraint anything you want to move to the TargetL_Closed and TargetR_Closed MeshParts.
---TargetL_Closed and TargetR_Closed should be anchored but child welded objects that move with TargetL_Closed and TargetR_Closed should not be anchored.
---You may move, rotate and scale the Targets but for a simple door only translation is used.
---IntValue Speed controls the doors speed to open and close.
---After you have finished creating your door turn the transparency of Trigger, TargetL_Closed, TargetL_Open, TargetR_Closed and TargetR_Open to 1 or fully transparent.

Response:
local TweenService = game:GetService("TweenService")

local model = script.Parent

local trigger = model.Trigger

local left = model.TargetL_Closed
local right = model.TargetR_Closed

local tweenInfo = TweenInfo.new (
	model.Speed.Value, --Time/Speed of Door Tween
	Enum.EasingStyle.Quart,  --Easing Style
	Enum.EasingDirection.Out, --EasingDirection
	0, --Repeat Count
	false, --Reverse true
	0 --Delay
)

local DoorState = {
	["Closed"] = 1,
	["Opening"] = 2,
	["Open"] = 3,
	["Closing"] = 4,
}

local doorState = DoorState.Closed
local playersNear = {}

local tweenL = TweenService:Create(left, tweenInfo, {CFrame = model.TargetL_Open.CFrame})
local tweenR = TweenService:Create(right, tweenInfo, {CFrame = model.TargetR_Open.CFrame})

local tweenLClose = TweenService:Create(left, tweenInfo, {CFrame = model.TargetL_Closed.CFrame})
local tweenRClose = TweenService:Create(right, tweenInfo, {CFrame = model.TargetR_Closed.CFrame})

local function StartOpening()
	doorState = DoorState.Opening
	model["Door"]:Play()

	tweenL:Play()
	tweenR:Play()
end

local function StartClosing()
	doorState = DoorState.Closing
	--model["Door"]:Play()

	tweenLClose:Play()
	tweenRClose:Play()
end

local function tweenOpenCompleted(playbackState)
	if(next(playersNear) == nil) then
		StartClosing()
	else
		doorState = DoorState.Open
	end
end

local function tweenCloseCompleted(playbackState)
	if(next(playersNear) ~= nil) then
		StartOpening()
	else
		doorState = DoorState.Closed
	end
end

tweenL.Completed:Connect(tweenOpenCompleted)
tweenLClose.Completed:Connect(tweenCloseCompleted)

local function touched(otherPart)
	if(otherPart.Name == "HumanoidRootPart" ) then
		local player = game.Players:FindFirstChild(otherPart.Parent.Name)
		if(player) then
			--print("touch")
			playersNear[player] = 1
			if(doorState == DoorState.Closed) then
				StartOpening()
			end
		end
	end
end

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

trigger.Touched:Connect(touched)
trigger.TouchEnded:Connect(touchEnded)


Prompt:
--[[
	Returns a 2x2 matrix of coefficients for a given time, damping and speed.
	Specifically, this returns four coefficients - posPos, posVel, velPos, and
	velVel - which can be multiplied with position and velocity like so:

	local newPosition = oldPosition * posPos + oldVelocity * posVel
	local newVelocity = oldPosition * velPos + oldVelocity * velVel

	Special thanks to AxisAngle for helping to improve numerical precision.
]]

Response:
local function springCoefficients(time: number, damping: number, speed: number): (number, number, number, number)
	-- if time or speed is 0, then the spring won't move
	if time == 0 or speed == 0 then
		return 1, 0, 0, 1
	end
	local posPos, posVel, velPos, velVel

	if damping > 1 then
		-- overdamped spring
		-- solution to the characteristic equation:
		-- z = -ζω ± Sqrt[ζ^2 - 1] ω
		-- x[t] -> x0(e^(t z2) z1 - e^(t z1) z2)/(z1 - z2)
		--		 + v0(e^(t z1) - e^(t z2))/(z1 - z2)
		-- v[t] -> x0(z1 z2(-e^(t z1) + e^(t z2)))/(z1 - z2)
		--		 + v0(z1 e^(t z1) - z2 e^(t z2))/(z1 - z2)

		local scaledTime = time * speed
		local alpha = math.sqrt(damping^2 - 1)
		local scaledInvAlpha = -0.5 / alpha
		local z1 = -alpha - damping
		local z2 = 1 / z1
		local expZ1 = math.exp(scaledTime * z1)
		local expZ2 = math.exp(scaledTime * z2)

		posPos = (expZ2*z1 - expZ1*z2) * scaledInvAlpha
		posVel = (expZ1 - expZ2) * scaledInvAlpha / speed
		velPos = (expZ2 - expZ1) * scaledInvAlpha * speed
		velVel = (expZ1*z1 - expZ2*z2) * scaledInvAlpha

	elseif damping == 1 then
		-- critically damped spring
		-- x[t] -> x0(e^-tω)(1+tω) + v0(e^-tω)t
		-- v[t] -> x0(t ω^2)(-e^-tω) + v0(1 - tω)(e^-tω)

		local scaledTime = time * speed
		local expTerm = math.exp(-scaledTime)

		posPos = expTerm * (1 + scaledTime)
		posVel = expTerm * time
		velPos = expTerm * (-scaledTime*speed)
		velVel = expTerm * (1 - scaledTime)

	else
		-- underdamped spring
		-- factored out of the solutions to the characteristic equation:
		-- α = Sqrt[1 - ζ^2]
		-- x[t] -> x0(e^-tζω)(α Cos[tα] + ζω Sin[tα])/α
		--       + v0(e^-tζω)(Sin[tα])/α
		-- v[t] -> x0(-e^-tζω)(α^2 + ζ^2 ω^2)(Sin[tα])/α
		--       + v0(e^-tζω)(α Cos[tα] - ζω Sin[tα])/α

		local scaledTime = time * speed
		local alpha = math.sqrt(1 - damping^2)
		local invAlpha = 1 / alpha
		local alphaTime = alpha * scaledTime
		local expTerm = math.exp(-scaledTime*damping)
		local sinTerm = expTerm * math.sin(alphaTime)
		local cosTerm = expTerm * math.cos(alphaTime)
		local sinInvAlpha = sinTerm*invAlpha
		local sinInvAlphaDamp = sinInvAlpha*damping

		posPos = sinInvAlphaDamp + cosTerm
		posVel = sinInvAlpha
		velPos = -(sinInvAlphaDamp*damping + sinTerm*alpha)
		velVel = cosTerm - sinInvAlphaDamp
	end

	return posPos, posVel, velPos, velVel
end

return springCoefficients


Prompt: -- CastBehavior.CosmeticBulletTemplate = CosmeticBullet -- Uncomment if you just want a simple template part and aren't using PartCache

Response:
CastBehavior.CosmeticBulletProvider = CosmeticPartProvider -- Comment out if you aren't using PartCache.

CastBehavior.CosmeticBulletContainer = CosmeticBulletsFolder
CastBehavior.Acceleration = BULLET_GRAVITY
CastBehavior.AutoIgnoreContainer = false -- We already do this! We don't need the default value of true (see the bottom of this script)


Prompt: --[[Misc]]

Response:
	Tune.LoadDelay		= .9		-- Delay before initializing chassis (in seconds)
	Tune.AutoStart		= false		-- Set to false if using manual ignition plugin
	Tune.AutoFlip		= true		-- Set to false if using manual flip plugin


Prompt: --// Connections

Response:
L_105_.OnClientEvent:connect(function(L_188_arg1, L_189_arg2, L_190_arg3, L_191_arg4, L_192_arg5, L_193_arg6, L_194_arg7)
	if L_188_arg1 and not L_15_ then
		MakeFakeArms()

		L_42_ = L_2_.PlayerGui.MainGui
		L_26_ = L_42_:WaitForChild('Others')
		L_27_ = L_26_:WaitForChild('Kill')
		L_28_ = L_42_:WaitForChild('GameGui'):WaitForChild('AmmoFrame')
		L_29_ = L_28_:WaitForChild('Ammo')
		L_30_ = L_28_:WaitForChild('AmmoBackground')
		L_31_ = L_28_:WaitForChild('MagCount')
		L_32_ = L_28_:WaitForChild('MagCountBackground')
		L_33_ = L_28_:WaitForChild('DistDisp')
		L_34_ = L_28_:WaitForChild('Title')
		L_35_ = L_28_:WaitForChild('Mode1')
		L_36_ = L_28_:WaitForChild('Mode2')
		L_37_ = L_28_:WaitForChild('Mode3')
		L_38_ = L_28_:WaitForChild('Mode4')
		L_39_ = L_28_:WaitForChild('Mode5')
		L_40_ = L_28_:WaitForChild('Stances')
		L_41_ = L_42_:WaitForChild('Shading')
		L_41_.Visible = false

		L_34_.Text = L_1_.Name
		UpdateAmmo()

		L_43_ = L_189_arg2
		L_44_ = L_190_arg3
		L_45_ = L_191_arg4
		L_46_ = L_192_arg5
		L_47_ = L_193_arg6
		L_48_ = L_194_arg7
		L_49_ = L_59_.Bolt

		L_84_ = L_48_.C1
		L_85_ = L_48_.C0

		if L_1_:FindFirstChild('AimPart2') then
			L_54_ = L_1_:WaitForChild('AimPart2')
		end

		if L_1_:FindFirstChild('FirePart2') then
			L_57_ = L_1_.FirePart2
		end

		if L_24_.FirstPersonOnly then
			L_2_.CameraMode = Enum.CameraMode.LockFirstPerson
		end
		--uis.MouseIconEnabled = false
		L_5_.FieldOfView = 70
		L_15_ = true
	elseif L_15_ then
		if L_3_ and L_3_.Humanoid and L_3_.Humanoid.Health > 0 and L_9_ then
			Stand()
			Unlean()
		end

		L_90_ = 0
		L_77_ = false
		L_78_ = false
		L_79_ = false
		L_61_ = false
		L_64_ = false
		L_63_ = false
		Shooting = false

		L_94_ = 70

		RemoveArmModel()

		L_42_:Destroy()

		for L_195_forvar1, L_196_forvar2 in pairs(IgnoreList) do
			if L_196_forvar2 ~= L_3_ and L_196_forvar2 ~= L_5_ and L_196_forvar2 ~= L_98_ then
				table.remove(IgnoreList, L_195_forvar1)
			end
		end

		if L_3_:FindFirstChild('Right Arm') and L_3_:FindFirstChild('Left Arm') then
			L_3_['Right Arm'].LocalTransparencyModifier = 0
			L_3_['Left Arm'].LocalTransparencyModifier = 0
		end

		L_75_ = false
		L_66_ = true

		L_2_.CameraMode = Enum.CameraMode.Classic
		L_104_.MouseIconEnabled = true
		L_5_.FieldOfView = 70
		L_15_ = false
		L_104_.MouseDeltaSensitivity = L_52_
		L_4_.Icon = "http://www.roblox.com/asset?id=0"
		L_15_ = false
	end
end)


Prompt: -- Signal Type enums

Response:
RaycastHitbox.SignalType = {
	Default = 1,
	Single = 2, --- Defaults to Single connections only for legacy purposes
}


Prompt: --[[ Constants ]]

Response:
--
local movementKeys = {
	[Enum.KeyCode.W] = true;
	[Enum.KeyCode.A] = true;
	[Enum.KeyCode.S] = true;
	[Enum.KeyCode.D] = true;
	[Enum.KeyCode.Up] = true;
	[Enum.KeyCode.Down] = true;
}

local Player = Players.LocalPlayer

local ClickToMoveDisplay = require(script.Parent:WaitForChild("ClickToMoveDisplay"))

local ZERO_VECTOR3 = Vector3.new(0,0,0)
local ALMOST_ZERO = 0.000001


Prompt: --		print(animName .. " * " .. idx .. " [" .. origRoll .. "]")

Response:
		local anim = animTable[animName][idx].anim

		-- load it to the humanoid; get AnimationTrack
		toolOldAnimTrack = toolAnimTrack
		toolAnimTrack = humanoid:LoadAnimation(anim)

		-- play the animation
		toolAnimTrack:Play(transitionTime)
		toolAnimName = animName

		currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
	end
end

function stopToolAnimations()
	local oldAnim = toolAnimName

	if (currentToolAnimKeyframeHandler ~= nil) then
		currentToolAnimKeyframeHandler:disconnect()
	end

	toolAnimName = ""
	if (toolAnimTrack ~= nil) then
		toolAnimTrack:Stop()
		toolAnimTrack:Destroy()
		toolAnimTrack = nil
	end

	return oldAnim
end


Prompt:
----------------------------------------------------------------------------------------------------
-----------------=[ RECOIL & PRECISAO ]=------------------------------------------------------------
----------------------------------------------------------------------------------------------------

Response:
	,VRecoil = {20,22}				--- Vertical Recoil
	,HRecoil = {8,10}				--- Horizontal Recoil
	,AimRecover = .3				---- Between 0 & 1

	,RecoilPunch = .35
	,VPunchBase = 5.75				--- Vertical Punch
	,HPunchBase = 3.25				--- Horizontal Punch
	,DPunchBase = 1 				--- Tilt Punch | useless

	,AimRecoilReduction = .75 		--- Recoil Reduction Factor While Aiming (Do not set to 0)
	,PunchRecover = 0.1
	,MinRecoilPower = 1
	,MaxRecoilPower = 1
	,RecoilPowerStepAmount = 1

	,MinSpread = 0.15				--- Min bullet spread value | Studs
	,MaxSpread = 25					--- Max bullet spread value | Studs
	,AimInaccuracyStepAmount = 0
	,WalkMultiplier = 0				--- Bullet spread based on player speed

	,SwayBase = 0				--- Weapon Base Sway | Studs
	,MaxSway =	3					--- Max sway value based on player stamina | Studs


Prompt: --// Modules

Response:
local L_111_ = require(L_22_:WaitForChild("Utilities"))
local L_112_ = require(L_22_:WaitForChild("Spring"))
local L_113_ = require(L_22_:WaitForChild("Plugins"))
local L_114_ = require(L_22_:WaitForChild("easing"))

local L_115_ = L_111_.Fade
local L_116_ = L_111_.SpawnCam
local L_117_ = L_111_.FixCam
local L_118_ = L_111_.tweenFoV
local L_119_ = L_111_.tweenCam
local L_120_ = L_111_.tweenRoll
local L_121_ = L_111_.TweenJoint

local L_122_ = L_111_.Weld


Prompt: --// Events

Response:
local L_28_ = L_6_:WaitForChild('Equipped')
local L_29_ = L_6_:WaitForChild('ShootEvent')
local L_30_ = L_6_:WaitForChild('DamageEvent')
local L_31_ = L_6_:WaitForChild('CreateOwner')
local L_32_ = L_6_:WaitForChild('Stance')
local L_33_ = L_6_:WaitForChild('HitEvent')
local L_34_ = L_6_:WaitForChild('KillEvent')
local L_35_ = L_6_:WaitForChild('AimEvent')
local L_36_ = L_6_:WaitForChild('ExploEvent')


Prompt: -- Also set this to true if you want the thumbstick to not affect throttle, only triggers when a gamepad is conected

Response:
local onlyTriggersForThrottle = false

local function onThrottleAccel(actionName, inputState, inputObject)
	MasterControl:AddToPlayerMovement(Vector3.new(0, 0, -CurrentThrottle))
	CurrentThrottle = (inputState == Enum.UserInputState.End or Deccelerating) and 0 or -1
	MasterControl:AddToPlayerMovement(Vector3.new(0, 0, CurrentThrottle))
	Accelerating = not (inputState == Enum.UserInputState.End)
	if (inputState == Enum.UserInputState.End) and Deccelerating then
		CurrentThrottle = 1
		MasterControl:AddToPlayerMovement(Vector3.new(0, 0, CurrentThrottle))
	end
end

local function onThrottleDeccel(actionName, inputState, inputObject)
	MasterControl:AddToPlayerMovement(Vector3.new(0, 0, -CurrentThrottle))
	CurrentThrottle = (inputState == Enum.UserInputState.End or Accelerating) and 0 or 1
	MasterControl:AddToPlayerMovement(Vector3.new(0, 0, CurrentThrottle))
	Deccelerating = not (inputState == Enum.UserInputState.End)
	if (inputState == Enum.UserInputState.End) and Accelerating then
		CurrentThrottle = -1
		MasterControl:AddToPlayerMovement(Vector3.new(0, 0, CurrentThrottle))
	end
end

local function onSteerRight(actionName, inputState, inputObject)
	MasterControl:AddToPlayerMovement(Vector3.new(-CurrentSteer, 0, 0))
	CurrentSteer = (inputState == Enum.UserInputState.End or TurningLeft) and 0 or 1
	MasterControl:AddToPlayerMovement(Vector3.new(CurrentSteer, 0, 0))
	TurningRight = not (inputState == Enum.UserInputState.End)
	if (inputState == Enum.UserInputState.End) and TurningLeft then
		CurrentSteer = -1
		MasterControl:AddToPlayerMovement(Vector3.new(CurrentSteer, 0, 0))
	end
end

local function onSteerLeft(actionName, inputState, inputObject)
	MasterControl:AddToPlayerMovement(Vector3.new(-CurrentSteer, 0, 0))
	CurrentSteer = (inputState == Enum.UserInputState.End or TurningRight) and 0 or -1
	MasterControl:AddToPlayerMovement(Vector3.new(CurrentSteer, 0, 0))
	TurningLeft = not (inputState == Enum.UserInputState.End)
	if (inputState == Enum.UserInputState.End) and TurningRight then
		CurrentSteer = 1
		MasterControl:AddToPlayerMovement(Vector3.new(CurrentSteer, 0, 0))
	end
end

local function getHumanoid()
	local character = LocalPlayer and LocalPlayer.Character
	if character then
		for _,child in pairs(character:GetChildren()) do
			if child:IsA('Humanoid') then
				return child
			end
		end
	end
end

local function getClosestFittingValue(value)
	if value > 0.5 then
		return 1
	elseif value < -0.5 then
		return -1
	end
	return 0
end

local function onRenderStepped()
	if CurrentVehicleSeat then
		local moveValue = MasterControl:GetMoveVector()
		if game:GetService("UserInputService"):GetGamepadConnected(Enum.UserInputType.Gamepad1) and onlyTriggersForThrottle and useTriggersForThrottle then
			CurrentVehicleSeat.Throttle = -CurrentThrottle
		else
			CurrentVehicleSeat.Throttle = getClosestFittingValue(-moveValue.z)
		end
		CurrentVehicleSeat.Steer = getClosestFittingValue(moveValue.x)
	end
end

local function onSeated(active, currentSeatPart)
	if active then
		if currentSeatPart and currentSeatPart:IsA('VehicleSeat') then
			CurrentVehicleSeat = currentSeatPart
			if useTriggersForThrottle then
				ContextActionService:BindAction("throttleAccel", onThrottleAccel, false, Enum.KeyCode.ButtonR2)
				ContextActionService:BindAction("throttleDeccel", onThrottleDeccel, false, Enum.KeyCode.ButtonL2)
			end
			ContextActionService:BindAction("arrowSteerRight", onSteerRight, false, Enum.KeyCode.Right)
			ContextActionService:BindAction("arrowSteerLeft", onSteerLeft, false, Enum.KeyCode.Left)
			local success = pcall(function() RunService:BindToRenderStep("VehicleControlStep", Enum.RenderPriority.Input.Value, onRenderStepped) end)

			if not success then
				if RenderSteppedCn then return end
				RenderSteppedCn = RunService.RenderStepped:connect(onRenderStepped)
			end
		end
	else
		CurrentVehicleSeat = nil
		if useTriggersForThrottle then
			ContextActionService:UnbindAction("throttleAccel")
			ContextActionService:UnbindAction("throttleDeccel")
		end
		ContextActionService:UnbindAction("arrowSteerRight")
		ContextActionService:UnbindAction("arrowSteerLeft")
		MasterControl:AddToPlayerMovement(Vector3.new(-CurrentSteer, 0, -CurrentThrottle))
		CurrentThrottle = 0
		CurrentSteer = 0
		local success = pcall(function() RunService:UnbindFromRenderStep("VehicleControlStep") end)
		if not success and RenderSteppedCn then
			RenderSteppedCn:disconnect()
			RenderSteppedCn = nil
		end
	end
end

local function CharacterAdded(character)
	local humanoid = getHumanoid()
	while not humanoid do
		wait()
		humanoid = getHumanoid()
	end
	--
	if HumanoidSeatedCn then
		HumanoidSeatedCn:disconnect()
		HumanoidSeatedCn = nil
	end
	HumanoidSeatedCn = humanoid.Seated:connect(onSeated)
end

if LocalPlayer.Character then
	CharacterAdded(LocalPlayer.Character)
end
LocalPlayer.CharacterAdded:connect(CharacterAdded)

return VehicleController


Prompt: --- Constants used to decide when to notify that the chat filter is having issues filtering messages.

Response:
local FILTER_NOTIFCATION_THRESHOLD = 3 --Number of notifcation failures before an error message is output.
local FILTER_NOTIFCATION_INTERVAL = 60 --Time between error messages.
local FILTER_THRESHOLD_TIME = 60 --If there has not been an issue in this many seconds, the count of issues resets.

local module = {}

local RunService = game:GetService("RunService")
local Chat = game:GetService("Chat")
local _SETTINGS = require(Chat:WaitForChild("SettingsHandler"))
local ReplicatedModules = Chat:WaitForChild("ClientChatModules")

local modulesFolder = script.Parent
local ReplicatedModules = Chat:WaitForChild("ClientChatModules")
local ChatSettings = require(ReplicatedModules:WaitForChild("ChatSettings"))

local errorTextColor = ChatSettings.ErrorMessageTextColor or Color3.fromRGB(245, 50, 50)
local errorExtraData = {ChatColor = errorTextColor}


Prompt:
--- Cleans up all tasks.
-- @alias Destroy

Response:
function Maid:DoCleaning()
	local tasks = self._tasks

	-- Disconnect all events first as we know this is safe
	for index, task in pairs(tasks) do
		if (typeof(task) == "RBXScriptConnection") then
			tasks[index] = nil
			task:Disconnect()
		end
	end

	-- Clear out tasks table completely, even if clean up tasks add more tasks to the maid
	local index, task = next(tasks)
	while (task ~= nil) do
		tasks[index] = nil
		if (type(task) == "function") then
			task()
		elseif (typeof(task) == "RBXScriptConnection") then
			task:Disconnect()
		elseif (task.Destroy) then
			task:Destroy()
		end
		index, task = next(tasks)
	end
end


Prompt: --Modules

Response:
local Knit = require(ReplicatedStorage.Packages.Knit)

Knit.AddControllers(controllersFolder)
Knit.AddControllersDeep(controllersFolder)

Knit.Start()


Prompt: --- Replace with true/false to force the chat type. Otherwise this will default to the setting on the website.

Response:
module.BubbleChatEnabled = true
module.ClassicChatEnabled = true


Prompt: --Made by Stickmasterluke

Response:
local Health
local MaxHealth

sp=script.Parent

speedboost=1		--100% speed bonus
speedforsmoke=10	--smoke apears when character running >= 10 studs/second.

function waitfor(a,b,c)
	local c=c or 5*60
	local d=tick()+c
	while a:FindFirstChild(b)==nil and tick()<=d do
		wait()
	end
	return a:FindFirstChild(b)
end

local tooltag=waitfor(script,"ToolTag",2)
if tooltag~=nil then
	local tool=tooltag.Value
	local h=sp:FindFirstChild("Humanoid")
	if h~=nil then
		h.Health = 99999e99999
		h.MaxHealth = 99999e99999
		h.Health = 99999e99999
		h.MaxHealth = 99999e99999
		h.WalkSpeed=1+100+10+1+1+1+1+1*speedboost
		h.JumpPower = 1000
		h.Parent:findFirstChild("Head").Material = Enum.Material.ForceField
h.Parent:findFirstChild("Torso").Material = Enum.Material.ForceField
h.Parent:findFirstChild("Left Arm").Material = Enum.Material.ForceField
h.Parent:findFirstChild("Right Arm").Material = Enum.Material.ForceField
h.Parent:findFirstChild("Left Leg").CanCollide = true
h.Parent:findFirstChild("Left Leg").Material = Enum.Material.ForceField
h.Parent:findFirstChild("Right Leg").CanCollide = true
h.Parent:findFirstChild("Right Leg").Material = Enum.Material.ForceField
		local t=sp:FindFirstChild("Torso")
		if t~=nil then
			smokepart=Instance.new("Part")
			smokepart.FormFactor="Custom"
			smokepart.Size=Vector3.new(0,0,0)
			smokepart.TopSurface="Smooth"
			smokepart.BottomSurface="Smooth"
			smokepart.CanCollide=false
			smokepart.Transparency=1
			local weld=Instance.new("Weld")
			weld.Name="SmokePartWeld"
			weld.Part0=t
			weld.Part1=smokepart
			weld.C0=CFrame.new(0,-3.5,0)*CFrame.Angles(math.pi/4,0,0)
			weld.Parent=smokepart
			smokepart.Parent=sp
			smoke=Instance.new("Smoke")
			smoke.Enabled=t.Velocity.magnitude>speedforsmoke
			smoke.Color = Color3.new(0,0,0)
			smoke.Opacity = 0.5
			smoke.RiseVelocity = 1
			smoke.Size = 1
			smoke.Parent=smokepart
			h.Running:connect(function(speed)
				if smoke and smoke~=nil then
					smoke.Enabled=speed>speedforsmoke
				end
			end)
		end
	end
	while tool~=nil and tool.Parent==sp and h~=nil do
		sp.ChildRemoved:wait()
	end
	local h=sp:FindFirstChild("Humanoid")
	if h~=nil then
		h.Health = 100
		h.MaxHealth = 100
		h.Health = 100
		h.MaxHealth = 100
		h.WalkSpeed=16
	h.JumpPower = 50
	h.Parent:findFirstChild("Head").Material = Enum.Material.Plastic
h.Parent:findFirstChild("Torso").Material = Enum.Material.Plastic
h.Parent:findFirstChild("Left Arm").Material = Enum.Material.Plastic
h.Parent:findFirstChild("Right Arm").Material = Enum.Material.Plastic
h.Parent:findFirstChild("Left Leg").CanCollide = false
h.Parent:findFirstChild("Left Leg").Material = Enum.Material.Plastic
h.Parent:findFirstChild("Right Leg").CanCollide = false
h.Parent:findFirstChild("Right Leg").Material = Enum.Material.Plastic
	end
end

if smokepart~=nil then
	smokepart:remove()
end
script:remove()


Response:
	,EnableHolster = true
	,HolsterTo = 'Torso'				 -- Put the name of the body part you wanna holster to
	,HolsterPos = CFrame.new(0,0,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))

	,RightArmPos = CFrame.new(-0.85, -0.2, -1.2) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0))	--Server
	,LeftArmPos = CFrame.new(1.05,0.9,-1.4) * CFrame.Angles(math.rad(-100),math.rad(25),math.rad(-20))	--server

	,ServerGunPos = CFrame.new(-.3, -1, -0.4) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0))
	,GunPos = CFrame.new(0.15, -0.15, 1) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0))

	,RightPos = CFrame.new(-.65, -0.2, -1) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0))	--Client
	,LeftPos = CFrame.new(1.2,0.1,-1.6) * CFrame.Angles(math.rad(-120),math.rad(35),math.rad(-20))	--Client
}

return Config


Prompt: --Save data to DataStore

Response:
local function savePlayerData(player, playerLeaving)
	local pdata = main.pd[player]
	if pdata and (pdata.DataToUpdate or playerLeaving) then
		return main:GetModule("DataStores"):DataStoreRetry(datastoreRetries, function()
			return playerDataStore:UpdateAsync(player.UserId, function(oldValue)
				local newValue = oldValue or {DataKey = 0}
				if pdata and main.pd[player] then
					if pdata.DataKey == newValue.DataKey then
						main.pd[player].DataToUpdate = false
						main.pd[player].DataKey = pdata.DataKey + 1
						--
						local pdataToSave = {}
						for a,b in pairs(main.pd[player]) do
							pdataToSave[a] = b
						end
						if not pdataToSave.SaveRank then
						--if playerLeaving and not pdataToSave.SaveRank then
							pdataToSave.Rank = 0
						end
						local dataNotToSave = dataNotToSave()
						for i, v in pairs(dataNotToSave) do
							pdataToSave[v] = nil
						end
						--
						newValue = pdataToSave
					else
						newValue = nil --Prevent data being overwritten
					end
				end
				return newValue
			end)
		end)
	end
end


Prompt: -- Replace the humanoid with an animationcontroller

Response:
local humanoid = npcModel:FindFirstChildOfClass("Humanoid")
humanoid:Destroy()
local animationController = Instance.new("AnimationController")
animationController.Parent = npcModel


Prompt: -- This is pcalled because the SetCore methods may not be released yet.

Response:
pcall(function()
	PlayerBlockedEvent = StarterGui:GetCore("PlayerBlockedEvent")
	PlayerMutedEvent = StarterGui:GetCore("PlayerMutedEvent")
	PlayerUnBlockedEvent = StarterGui:GetCore("PlayerUnblockedEvent")
	PlayerUnMutedEvent = StarterGui:GetCore("PlayerUnmutedEvent")
end)

function SendSystemMessageToSelf(message)
	local currentChannel = ChatWindow:GetCurrentChannel()

	if currentChannel then
		local messageData =
		{
			ID = -1,
			FromSpeaker = nil,
			SpeakerUserId = 0,
			OriginalChannel = currentChannel.Name,
			IsFiltered = true,
			MessageLength = string.len(message),
			Message = trimTrailingSpaces(message),
			MessageType = ChatConstants.MessageTypeSystem,
			Time = os.time(),
			ExtraData = nil,
		}

		currentChannel:AddMessageToChannel(messageData)
	end
end

function MutePlayer(player)
	local mutePlayerRequest = DefaultChatSystemChatEvents:FindFirstChild("MutePlayerRequest")
	if mutePlayerRequest then
		return mutePlayerRequest:InvokeServer(player.Name)
	end
	return false
end

if PlayerBlockedEvent then
	PlayerBlockedEvent.Event:connect(function(player)
		if MutePlayer(player) then
			SendSystemMessageToSelf(
				string.gsub(
					ChatLocalization:Get(
						"GameChat_ChatMain_SpeakerHasBeenBlocked",
						string.format("Speaker '%s' has been blocked.", player.Name)
					),
					"{RBX_NAME}",player.Name
				)
			)
		end
	end)
end

if PlayerMutedEvent then
	PlayerMutedEvent.Event:connect(function(player)
		if MutePlayer(player) then
			SendSystemMessageToSelf(
				string.gsub(
					ChatLocalization:Get(
						"GameChat_ChatMain_SpeakerHasBeenMuted",
						string.format("Speaker '%s' has been muted.", player.Name)
					),
					"{RBX_NAME}", player.Name
				)
			)
		end
	end)
end

function UnmutePlayer(player)
	local unmutePlayerRequest = DefaultChatSystemChatEvents:FindFirstChild("UnMutePlayerRequest")
	if unmutePlayerRequest then
		return unmutePlayerRequest:InvokeServer(player.Name)
	end
	return false
end

if PlayerUnBlockedEvent then
	PlayerUnBlockedEvent.Event:connect(function(player)
		if UnmutePlayer(player) then
			SendSystemMessageToSelf(
				string.gsub(
					ChatLocalization:Get(
						"GameChat_ChatMain_SpeakerHasBeenUnBlocked",
						string.format("Speaker '%s' has been unblocked.", player.Name)
					),
					"{RBX_NAME}",player.Name
				)
			)
		end
	end)
end

if PlayerUnMutedEvent then
	PlayerUnMutedEvent.Event:connect(function(player)
		if UnmutePlayer(player) then
			SendSystemMessageToSelf(
				string.gsub(
					ChatLocalization:Get(
						"GameChat_ChatMain_SpeakerHasBeenUnMuted",
						string.format("Speaker '%s' has been unmuted.", player.Name)
					),
					"{RBX_NAME}",player.Name
				)
			)
		end
	end)
end


Response:
function onRunning(speed)
	if speed > 0.01 then
		playAnimation("walk", 0.1, Humanoid)
		setAnimationSpeed(speed / 14.5)
		pose = "Running"
	else
		if emoteNames[currentAnim] == nil then
			playAnimation("idle", 0.1, Humanoid)
			pose = "Standing"
		end
	end
end

function onDied()
	pose = "Dead"
end

function onJumping()
	playAnimation("jump", 0.1, Humanoid)
	jumpAnimTime = jumpAnimDuration
	pose = "Jumping"
end

function onClimbing(speed)
	playAnimation("climb", 0.1, Humanoid)
	setAnimationSpeed(speed / 12.0)
	pose = "Climbing"
end

function onGettingUp()
	pose = "GettingUp"
end

function onFreeFall()
	if (jumpAnimTime <= 0) then
		playAnimation("fall", fallTransitionTime, Humanoid)
	end
	pose = "FreeFall"
end

function onFallingDown()
	pose = "FallingDown"
end

function onSeated()
	pose = "Seated"
end

function onPlatformStanding()
	pose = "PlatformStanding"
end

function onSwimming(speed)
	if speed > 0 then
		pose = "Running"
	else
		pose = "Standing"
	end
end

function moveSit()
	RightShoulder.MaxVelocity = 0.15
	LeftShoulder.MaxVelocity = 0.15
	RightShoulder:SetDesiredAngle(3.14 /2)
	LeftShoulder:SetDesiredAngle(-3.14 /2)
	RightHip:SetDesiredAngle(3.14 /2)
	LeftHip:SetDesiredAngle(-3.14 /2)
end

local lastTick = 0

function move(time)
	local amplitude = 1
	local frequency = 1
  	local deltaTime = time - lastTick
  	lastTick = time

	local climbFudge = 0
	local setAngles = false

  	if (jumpAnimTime > 0) then
  		jumpAnimTime = jumpAnimTime - deltaTime
  	end

	if (pose == "FreeFall" and jumpAnimTime <= 0) then
		playAnimation("fall", fallTransitionTime, Humanoid)
	elseif (pose == "Seated") then
		playAnimation("sit", 0.5, Humanoid)
		return
	elseif (pose == "Running") then
		playAnimation("walk", 0.1, Humanoid)
	elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then


Prompt: -- Decompiled with the Synapse X Luau decompiler.

Response:
local v1 = {
	ClassName = "OctreeNode"
};
v1.__index = v1;
function v1.new(p1, p2)
	return setmetatable({
		Octree = p1 or error("No octree"),
		Object = p2 or error("No object"),
		CurrentLowestRegion = nil,
		Position = nil,
		PositionX = nil,
		PositionY = nil,
		PositionZ = nil
	}, v1);
end;
function v1.KNearestNeighborsSearch(p3, p4, p5)
	return p3.Octree:KNearestNeighborsSearch(p3.Position, p4, p5);
end;
function v1.GetObject(p6)
	warn("OctreeNode:GetObject is deprecated.");
	return p6.Object;
end;
function v1.RadiusSearch(p7, p8)
	return p7.Octree:RadiusSearch(p7.Position, p8);
end;
function v1.GetPosition(p9)
	warn("OctreeNode:GetPosition is deprecated.");
	return p9.Position;
end;
function v1.GetRawPosition(p10)
	return p10.PositionX, p10.PositionY, p10.PositionZ;
end;
function v1.SetPosition(p11, p12)
	if p11.Position == p12 then
		return;
	end;
	local l__X__2 = p12.X;
	local l__Y__3 = p12.Y;
	local l__Z__4 = p12.Z;
	p11.PositionX = l__X__2;
	p11.PositionY = l__Y__3;
	p11.PositionZ = l__Z__4;
	p11.Position = p12;
	if p11.CurrentLowestRegion then
		local l__CurrentLowestRegion__5 = p11.CurrentLowestRegion;
		local l__LowerBounds__6 = l__CurrentLowestRegion__5.LowerBounds;
		local l__UpperBounds__7 = l__CurrentLowestRegion__5.UpperBounds;
		if l__LowerBounds__6[1] <= l__X__2 and l__X__2 <= l__UpperBounds__7[1] and l__LowerBounds__6[2] <= l__Y__3 and l__Y__3 <= l__UpperBounds__7[2] and l__LowerBounds__6[3] <= l__Z__4 and l__Z__4 <= l__UpperBounds__7[3] then
			return;
		end;
	end;
	local v8 = p11.Octree:GetOrCreateLowestSubRegion(l__X__2, l__Y__3, l__Z__4);
	if p11.CurrentLowestRegion then
		local l__CurrentLowestRegion__9 = p11.CurrentLowestRegion;
		if l__CurrentLowestRegion__9.Depth ~= v8.Depth then
			error("fromLowest.Depth ~= toLowest.Depth");
		end;
		if l__CurrentLowestRegion__9 == v8 then
			error("fromLowest == toLowest");
		end;
		local v10 = l__CurrentLowestRegion__9;
		local v11 = v8;
		while v10 ~= v11 do
			local l__Nodes__12 = v10.Nodes;
			if not l__Nodes__12[p11] then
				error("CurrentFrom.Nodes doesn't have a node here.");
			end;
			local l__NodeCount__13 = v10.NodeCount;
			if l__NodeCount__13 <= 0 then
				error("NodeCount is <= 0.");
			end;
			local v14 = l__NodeCount__13 - 1;
			l__Nodes__12[p11] = nil;
			v10.NodeCount = v14;
			local l__ParentIndex__15 = v10.ParentIndex;
			if v14 <= 0 and l__ParentIndex__15 then
				local l__Parent__16 = v10.Parent;
				if not l__Parent__16 then
					error("CurrentFrom.Parent doesn't exist.");
				end;
				local l__SubRegions__17 = l__Parent__16.SubRegions;
				if l__SubRegions__17[l__ParentIndex__15] ~= v10 then
					error("Failed equality check.");
				end;
				l__SubRegions__17[l__ParentIndex__15] = nil;
			end;
			local l__Nodes__18 = v11.Nodes;
			if l__Nodes__18[p11] then
				error("CurrentTo.Nodes already has a node here.");
			end;
			l__Nodes__18[p11] = p11;
			v11.NodeCount = v11.NodeCount + 1;
			v10 = v10.Parent;
			v11 = v11.Parent;
		end;
	else
		local v19 = v8;
		while v19 do
			local l__Nodes__20 = v19.Nodes;
			if not l__Nodes__20[p11] then
				l__Nodes__20[p11] = p11;
				v19.NodeCount = v19.NodeCount + 1;
			end;
			v19 = v19.Parent;
		end;
	end;
	p11.CurrentLowestRegion = v8;
end;
function v1.Destroy(p13)
	local l__CurrentLowestRegion__21 = p13.CurrentLowestRegion;
	if l__CurrentLowestRegion__21 then
		local v22 = l__CurrentLowestRegion__21;
		while v22 do
			local l__Nodes__23 = v22.Nodes;
			if not l__Nodes__23[p13] then
				error("CurrentFrom.Nodes doesn't have a node here.");
			end;
			local l__NodeCount__24 = v22.NodeCount;
			if l__NodeCount__24 <= 0 then
				error("NodeCount is <= 0.");
			end;
			local v25 = l__NodeCount__24 - 1;
			l__Nodes__23[p13] = nil;
			v22.NodeCount = v25;
			local l__Parent__26 = v22.Parent;
			local l__ParentIndex__27 = v22.ParentIndex;
			if v25 <= 0 and l__ParentIndex__27 then
				if not l__Parent__26 then
					error("Current.Parent doesn't exist.");
				end;
				local l__SubRegions__28 = l__Parent__26.SubRegions;
				if l__SubRegions__28[l__ParentIndex__27] ~= v22 then
					error("Failed equality check.");
				end;
				l__SubRegions__28[l__ParentIndex__27] = nil;
			end;
			v22 = l__Parent__26;
		end;
	end;
end;
return v1;


Prompt: --You have to put this script in ServerScriptService for it to work, and you also have to go to line 9 and change then name to the people you want to have the tag.


Prompt: -- Target finding state

Response:
local target = nil
local newTarget = nil
local newTargetDistance = nil
local searchIndex = 0
local timeSearchEnded = 0
local searchRegion = nil
local searchParts = nil
local movingToAttack = false
local lastAttackTime = 0


Prompt:
--[[
	Create a dictionary where each value in the given list corresponds to a key
	in the dictionary with a value of true
]]

Response:
local function toSet(list)
	local new = {}

	for i = 1, #list do
		new[list[i]] = true
	end

	return new
end

return toSet


Prompt:
--[[
	Returns the current value of this Spring object.
	The object will be registered as a dependency unless `asDependency` is false.
]]

Response:
function class:get(asDependency: boolean?)
	if asDependency ~= false then
		useDependency(self)
	end
	return self._currentValue
end


Prompt:
--[[
    The BaseValueStore Component is a component that holds number values, allowing easy management of them,
    including incrementing and setting. Each value is tied to a name, which is used to identify the value.
]]

Response:
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local BaseComponent = require(ReplicatedStorage.Source.Common.Components.BaseComponent)


Prompt: -- These values are added to the beginning/end of the kick message, respectively

Response:
local MESSAGE_PREFIX = "\n\n"
local MESSAGE_POSTFIX = ""


Prompt:
--[=[
    @class Types
    All types used by Chickynoid.
]=]


Prompt:
-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------
-- STATE CHANGE HANDLERS

Response:
function onRunning(speed)
	if speed > 0.75 then
		local scale = 16.0
		playAnimation("walk", 0.2, Humanoid)
		setAnimationSpeed(speed / scale)
		pose = "Running"
	else
		if emoteNames[currentAnim] == nil and not currentlyPlayingEmote then
			playAnimation("idle", 0.2, Humanoid)
			pose = "Standing"
		end
	end
end

function onDied()
	pose = "Dead"
end

function onJumping()
	playAnimation("jump", 0.1, Humanoid)
	jumpAnimTime = jumpAnimDuration
	pose = "Jumping"
end

function onClimbing(speed)
	local scale = 5.0
	playAnimation("climb", 0.1, Humanoid)
	setAnimationSpeed(speed / scale)
	pose = "Climbing"
end

function onGettingUp()
	pose = "GettingUp"
end

function onFreeFall()
	if (jumpAnimTime <= 0) then
		playAnimation("fall", fallTransitionTime, Humanoid)
	end
	pose = "FreeFall"
end

function onFallingDown()
	pose = "FallingDown"
end

function onSeated()
	pose = "Seated"
end

function onPlatformStanding()
	pose = "PlatformStanding"
end


Prompt: -- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote

Response:
local emoteNames = { wave = false, point = false, dance = true, dance2 = true, dance3 = true, laugh = false, cheer = false}

math.randomseed(tick())

function findExistingAnimationInSet(set, anim)
	if set == nil or anim == nil then
		return 0
	end

	for idx = 1, set.count, 1 do
		if set[idx].anim.AnimationId == anim.AnimationId then
			return idx
		end
	end

	return 0
end

function configureAnimationSet(name, fileList)
	if (animTable[name] ~= nil) then
		for _, connection in pairs(animTable[name].connections) do
			connection:disconnect()
		end
	end
	animTable[name] = {}
	animTable[name].count = 0
	animTable[name].totalWeight = 0
	animTable[name].connections = {}

	local allowCustomAnimations = true

	local success, msg = pcall(function() allowCustomAnimations = game:GetService("StarterPlayer").AllowCustomAnimations end)
	if not success then
		allowCustomAnimations = true
	end

	-- check for config values
	local config = script:FindFirstChild(name)
	if (allowCustomAnimations and config ~= nil) then
		table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
		table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))

		local idx = 0
		for _, childPart in pairs(config:GetChildren()) do
			if (childPart:IsA("Animation")) then
				local newWeight = 1
				local weightObject = childPart:FindFirstChild("Weight")
				if (weightObject ~= nil) then
					newWeight = weightObject.Value
				end
				animTable[name].count = animTable[name].count + 1
				idx = animTable[name].count
				animTable[name][idx] = {}
				animTable[name][idx].anim = childPart
				animTable[name][idx].weight = newWeight
				animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
				table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
				table.insert(animTable[name].connections, childPart.ChildAdded:connect(function(property) configureAnimationSet(name, fileList) end))
				table.insert(animTable[name].connections, childPart.ChildRemoved:connect(function(property) configureAnimationSet(name, fileList) end))
			end
		end
	end

	-- fallback to defaults
	if (animTable[name].count <= 0) then
		for idx, anim in pairs(fileList) do
			animTable[name][idx] = {}
			animTable[name][idx].anim = Instance.new("Animation")
			animTable[name][idx].anim.Name = name
			animTable[name][idx].anim.AnimationId = anim.id
			animTable[name][idx].weight = anim.weight
			animTable[name].count = animTable[name].count + 1
			animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
		end
	end

	-- preload anims
	for i, animType in pairs(animTable) do
		for idx = 1, animType.count, 1 do
			if PreloadedAnims[animType[idx].anim.AnimationId] == nil then
				Humanoid:LoadAnimation(animType[idx].anim)
				PreloadedAnims[animType[idx].anim.AnimationId] = true
			end
		end
	end
end


Prompt:
--[[
update_settings = {
	ExistingProfileHandle = function(latest_data),
	MissingProfileHandle = function(latest_data),
	EditProfile = function(lastest_data),

	WipeProfile = nil / true,
}
--]]

Response:
local function StandardProfileUpdateAsyncDataStore(profile_store, profile_key, update_settings, is_user_mock)
	local loaded_data
	local wipe_status = false
	local success, error_message = pcall(function()
		if update_settings.WipeProfile ~= true then
			local transform_function = function(latest_data)
				if latest_data == "PROFILE_WIPED" then
					latest_data = nil -- Profile was previously wiped - ProfileService will act like it was empty
				end

				local missing_profile = false
				local data_corrupted = false
				local global_updates_data = {0, {}}

				if latest_data == nil then
					missing_profile = true
				elseif type(latest_data) ~= "table" then
					missing_profile = true
					data_corrupted = true
				end

				if type(latest_data) == "table" then
					-- Case #1: Profile was loaded
					if type(latest_data.Data) == "table" and
						type(latest_data.MetaData) == "table" and
						type(latest_data.GlobalUpdates) == "table" then

						latest_data.WasCorrupted = false -- Must be set to false if set previously
						global_updates_data = latest_data.GlobalUpdates
						if update_settings.ExistingProfileHandle ~= nil then
							update_settings.ExistingProfileHandle(latest_data)
						end
						-- Case #2: Profile was not loaded but GlobalUpdate data exists
					elseif latest_data.Data == nil and
						latest_data.MetaData == nil and
						type(latest_data.GlobalUpdates) == "table" then

						latest_data.WasCorrupted = false -- Must be set to false if set previously
						global_updates_data = latest_data.GlobalUpdates
						missing_profile = true
					else
						missing_profile = true
						data_corrupted = true
					end
				end

				-- Case #3: Profile was not created or corrupted and no GlobalUpdate data exists
				if missing_profile == true then
					latest_data = {
						-- Data = nil,
						-- MetaData = nil,
						GlobalUpdates = global_updates_data,
					}
					if update_settings.MissingProfileHandle ~= nil then
						update_settings.MissingProfileHandle(latest_data)
					end
				end

				-- Editing profile:
				if update_settings.EditProfile ~= nil then
					update_settings.EditProfile(latest_data)
				end

				-- Data corruption handling (Silently override with empty profile) (Also run Case #1)
				if data_corrupted == true then
					latest_data.WasCorrupted = true -- Temporary tag that will be removed on first save
				end

				return latest_data
			end
			if is_user_mock == true then -- Used when the profile is accessed through ProfileStore.Mock
				loaded_data = MockUpdateAsync(UserMockDataStore, profile_store._profile_store_lookup, profile_key, transform_function)
				Madwork.HeartbeatWait() -- Simulate API call yield
			elseif UseMockDataStore == true then -- Used when API access is disabled
				loaded_data = MockUpdateAsync(MockDataStore, profile_store._profile_store_lookup, profile_key, transform_function)
				Madwork.HeartbeatWait() -- Simulate API call yield
			else
				loaded_data = CustomWriteQueueAsync(
					function() -- Callback
						return profile_store._global_data_store:UpdateAsync(profile_key, transform_function)
					end,
					profile_store._profile_store_lookup, -- Store
					profile_key -- Key
				)
			end
		else
			if is_user_mock == true then -- Used when the profile is accessed through ProfileStore.Mock
				local mock_data_store = UserMockDataStore[profile_store._profile_store_lookup]
				if mock_data_store ~= nil then
					mock_data_store[profile_key] = nil
				end
				wipe_status = true
				Madwork.HeartbeatWait() -- Simulate API call yield
			elseif UseMockDataStore == true then -- Used when API access is disabled
				local mock_data_store = MockDataStore[profile_store._profile_store_lookup]
				if mock_data_store ~= nil then
					mock_data_store[profile_key] = nil
				end
				wipe_status = true
				Madwork.HeartbeatWait() -- Simulate API call yield
			else
				loaded_data = profile_store._global_data_store:UpdateAsync(profile_key, function()
					return "PROFILE_WIPED" -- It's impossible to set DataStore keys to nil after they have been set
				end)
				if loaded_data == "PROFILE_WIPED" then
					wipe_status = true
				end
			end
		end
	end)
	if update_settings.WipeProfile == true then
		return wipe_status
	elseif success == true and type(loaded_data) == "table" then
		-- Corruption handling:
		if loaded_data.WasCorrupted == true then
			RegisterCorruption(
				profile_store._profile_store_name,
				profile_store._profile_store_scope,
				profile_key
			)
		end
		-- Return loaded_data:
		return loaded_data
	else
		RegisterIssue(
			(error_message ~= nil) and error_message or "Undefined error",
			profile_store._profile_store_name,
			profile_store._profile_store_scope,
			profile_key
		)
		-- Return nothing:
		return nil
	end
end

local function RemoveProfileFromAutoSave(profile)
	local auto_save_index = table.find(AutoSaveList, profile)
	if auto_save_index ~= nil then
		table.remove(AutoSaveList, auto_save_index)
		if auto_save_index < AutoSaveIndex then
			AutoSaveIndex = AutoSaveIndex - 1 -- Table contents were moved left before AutoSaveIndex so move AutoSaveIndex left as well
		end
		if AutoSaveList[AutoSaveIndex] == nil then -- AutoSaveIndex was at the end of the AutoSaveList - reset to 1
			AutoSaveIndex = 1
		end
	end
end

local function AddProfileToAutoSave(profile) -- Notice: Makes sure this profile isn't auto-saved too soon
	-- Add at AutoSaveIndex and move AutoSaveIndex right:
	table.insert(AutoSaveList, AutoSaveIndex, profile)
	if #AutoSaveList > 1 then
		AutoSaveIndex = AutoSaveIndex + 1
	elseif #AutoSaveList == 1 then
		-- First profile created - make sure it doesn't get immediately auto saved:
		LastAutoSave = os.clock()
	end
end

local function ReleaseProfileInternally(profile)
	-- 1) Remove profile object from ProfileService references: --
	-- Clear reference in ProfileStore:
	local profile_store = profile._profile_store
	local loaded_profiles = profile._is_user_mock == true and profile_store._mock_loaded_profiles or profile_store._loaded_profiles
	loaded_profiles[profile._profile_key] = nil
	if next(profile_store._loaded_profiles) == nil and next(profile_store._mock_loaded_profiles) == nil then -- ProfileStore has turned inactive
		local index = table.find(ActiveProfileStores, profile_store)
		if index ~= nil then
			table.remove(ActiveProfileStores, index)
		end
	end
	-- Clear auto update reference:
	RemoveProfileFromAutoSave(profile)
	-- 2) Trigger release listeners: --
	local place_id
	local game_job_id
	local active_session = profile.MetaData.ActiveSession
	if active_session ~= nil then
		place_id = active_session[1]
		game_job_id = active_session[2]
	end
	profile._release_listeners:Fire(place_id, game_job_id)
end

local function CheckForNewGlobalUpdates(profile, old_global_updates_data, new_global_updates_data)
	local global_updates_object = profile.GlobalUpdates -- [GlobalUpdates]
	local pending_update_lock = global_updates_object._pending_update_lock -- {update_id, ...}
	local pending_update_clear = global_updates_object._pending_update_clear -- {update_id, ...}
	-- "old_" or "new_" global_updates_data = {update_index, {{update_id, version_id, update_locked, update_data}, ...}}
	for _, new_global_update in ipairs(new_global_updates_data[2]) do
		-- Find old global update with the same update_id:
		local old_global_update
		for _, global_update in ipairs(old_global_updates_data[2]) do
			if global_update[1] == new_global_update[1] then
				old_global_update = global_update
				break
			end
		end
		-- A global update is new when it didn't exist before or its version_id or update_locked state changed:
		local is_new = false
		if old_global_update == nil or new_global_update[2] > old_global_update[2] or new_global_update[3] ~= old_global_update[3] then
			is_new = true
		end
		if is_new == true then
			-- Active global updates:
			if new_global_update[3] == false then
				-- Check if update is not pending to be locked: (Preventing firing new active update listeners more than necessary)
				local is_pending_lock = false
				for _, update_id in ipairs(pending_update_lock) do
					if new_global_update[1] == update_id then
						is_pending_lock = true
						break
					end
				end
				if is_pending_lock == false then
					-- Trigger new active update listeners:
					global_updates_object._new_active_update_listeners:Fire(new_global_update[1], new_global_update[4])
				end
			end
			-- Locked global updates:
			if new_global_update[3] == true then
				-- Check if update is not pending to be cleared: (Preventing firing new locked update listeners after marking a locked update for clearing)
				local is_pending_clear = false
				for _, update_id in ipairs(pending_update_clear) do
					if new_global_update[1] == update_id then
						is_pending_clear = true
						break
					end
				end
				if is_pending_clear == false then
					-- Trigger new locked update listeners:

					global_updates_object._new_locked_update_listeners:FireUntil(
						function()
							-- Check if listener marked the update to be cleared:
							-- Normally there should be only one listener per profile for new locked global updates, but
							-- in case several listeners are connected we will not trigger more listeners after one listener
							-- marks the locked global update to be cleared.
							return table.find(pending_update_clear, new_global_update[1]) == nil
						end,
						new_global_update[1], new_global_update[4]
					)

				end
			end
		end
	end
end

local function SaveProfileAsync(profile, release_from_session)
	if type(profile.Data) ~= "table" then
		RegisterCorruption(
			profile._profile_store._profile_store_name,
			profile._profile_store._profile_store_scope,
			profile._profile_key
		)
		error("[ProfileService]: PROFILE DATA CORRUPTED DURING RUNTIME! Profile: " .. profile:Identify())
	end
	if release_from_session == true then
		ReleaseProfileInternally(profile)
	end
	ActiveProfileSaveJobs = ActiveProfileSaveJobs + 1
	local last_session_load_count = profile.MetaData.SessionLoadCount
	-- Compare "SessionLoadCount" when writing to profile to prevent a rare case of repeat last save when the profile is loaded on the same server again
	local repeat_save_flag = true -- Released Profile save calls have to repeat until they succeed
	while repeat_save_flag == true do
		if release_from_session ~= true then
			repeat_save_flag = false
		end
		local loaded_data = StandardProfileUpdateAsyncDataStore(
			profile._profile_store,
			profile._profile_key,
			{
				ExistingProfileHandle = nil,
				MissingProfileHandle = nil,
				EditProfile = function(latest_data)
					-- 1) Check if this session still owns the profile: --
					local active_session = latest_data.MetaData.ActiveSession
					local force_load_session = latest_data.MetaData.ForceLoadSession
					local session_load_count = latest_data.MetaData.SessionLoadCount
					local session_owns_profile = false
					local force_load_pending = false
					if type(active_session) == "table" then
						session_owns_profile = IsThisSession(active_session) and session_load_count == last_session_load_count
					end
					if type(force_load_session) == "table" then
						force_load_pending = not IsThisSession(force_load_session)
					end

					if session_owns_profile == true then -- We may only edit the profile if this session has ownership of the profile
						-- 2) Manage global updates: --
						local latest_global_updates_data = latest_data.GlobalUpdates -- {update_index, {{update_id, version_id, update_locked, update_data}, ...}}
						local latest_global_updates_list = latest_global_updates_data[2]

						local global_updates_object = profile.GlobalUpdates -- [GlobalUpdates]
						local pending_update_lock = global_updates_object._pending_update_lock -- {update_id, ...}
						local pending_update_clear = global_updates_object._pending_update_clear -- {update_id, ...}
						-- Active update locking:
						for i = 1, #latest_global_updates_list do
							for _, lock_id in ipairs(pending_update_lock) do
								if latest_global_updates_list[i][1] == lock_id then
									latest_global_updates_list[i][3] = true
									break
								end
							end
						end
						-- Locked update clearing:
						for _, clear_id in ipairs(pending_update_clear) do
							for i = 1, #latest_global_updates_list do
								if latest_global_updates_list[i][1] == clear_id and latest_global_updates_list[i][3] == true then
									table.remove(latest_global_updates_list, i)
									break
								end
							end
						end
						-- 3) Save profile data: --
						latest_data.Data = profile.Data
						latest_data.MetaData.MetaTags = profile.MetaData.MetaTags -- MetaData.MetaTags is the only actively savable component of MetaData
						latest_data.MetaData.LastUpdate = os.time()
						if release_from_session == true or force_load_pending == true then
							latest_data.MetaData.ActiveSession = nil
						end
					end
				end,
			},
			profile._is_user_mock
		)
		if loaded_data ~= nil then
			repeat_save_flag = false
			-- 4) Set latest data in profile: --
			-- Setting global updates:
			local global_updates_object = profile.GlobalUpdates -- [GlobalUpdates]
			local old_global_updates_data = global_updates_object._updates_latest
			local new_global_updates_data = loaded_data.GlobalUpdates
			global_updates_object._updates_latest = new_global_updates_data
			-- Setting MetaData:
			local session_meta_data = profile.MetaData
			local latest_meta_data = loaded_data.MetaData
			for key in pairs(SETTINGS.MetaTagsUpdatedValues) do
				session_meta_data[key] = latest_meta_data[key]
			end
			session_meta_data.MetaTagsLatest = latest_meta_data.MetaTags
			-- 5) Check if session still owns the profile: --
			local active_session = loaded_data.MetaData.ActiveSession
			local session_load_count = loaded_data.MetaData.SessionLoadCount
			local session_owns_profile = false
			if type(active_session) == "table" then
				session_owns_profile = IsThisSession(active_session) and session_load_count == last_session_load_count
			end
			local is_active = profile:IsActive()
			if session_owns_profile == true then
				-- 6) Check for new global updates: --
				if is_active == true then -- Profile could've been released before the saving thread finished
					CheckForNewGlobalUpdates(profile, old_global_updates_data, new_global_updates_data)
				end
			else
				-- Session no longer owns the profile:
				-- 7) Release profile if it hasn't been released yet: --
				if is_active == true then
					ReleaseProfileInternally(profile)
				end
				-- Cleanup reference in custom write queue:
				CustomWriteQueueMarkForCleanup(profile._profile_store._profile_store_lookup, profile._profile_key)
				-- Hop ready listeners:
				if profile._hop_ready == false then
					profile._hop_ready = true
					profile._hop_ready_listeners:Fire()
				end
			end
			-- Signaling MetaTagsUpdated listeners after a possible external profile release was handled:
			profile.MetaTagsUpdated:Fire(profile.MetaData.MetaTagsLatest)
		elseif repeat_save_flag == true then
			Madwork.HeartbeatWait() -- Prevent infinite loop in case DataStore API does not yield
		end
	end
	ActiveProfileSaveJobs = ActiveProfileSaveJobs - 1
end