Prompt: -- This function converts 4 different, redundant enumeration types to one standard so the values can be compared

Response:
function CameraUtils.ConvertCameraModeEnumToStandard( enumValue )

	if enumValue == Enum.TouchCameraMovementMode.Default then
		return Enum.ComputerCameraMovementMode.Follow
	end

	if enumValue == Enum.ComputerCameraMovementMode.Default then
		return Enum.ComputerCameraMovementMode.Classic
	end

	if enumValue == Enum.TouchCameraMovementMode.Classic or
		enumValue == Enum.DevTouchCameraMovementMode.Classic or
		enumValue == Enum.DevComputerCameraMovementMode.Classic or
		enumValue == Enum.ComputerCameraMovementMode.Classic then
		return Enum.ComputerCameraMovementMode.Classic
	end

	if enumValue == Enum.TouchCameraMovementMode.Follow or
		enumValue == Enum.DevTouchCameraMovementMode.Follow or
		enumValue == Enum.DevComputerCameraMovementMode.Follow or
		enumValue == Enum.ComputerCameraMovementMode.Follow then
		return Enum.ComputerCameraMovementMode.Follow
	end

	if enumValue == Enum.TouchCameraMovementMode.Orbital or
		enumValue == Enum.DevTouchCameraMovementMode.Orbital or
		enumValue == Enum.DevComputerCameraMovementMode.Orbital or
		enumValue == Enum.ComputerCameraMovementMode.Orbital then
		return Enum.ComputerCameraMovementMode.Orbital
	end

	-- Note: Only the Dev versions of the Enums have UserChoice as an option
	if enumValue == Enum.DevTouchCameraMovementMode.UserChoice or
		enumValue == Enum.DevComputerCameraMovementMode.UserChoice then
		return Enum.DevComputerCameraMovementMode.UserChoice
	end

	-- For any unmapped options return Classic camera
	return Enum.ComputerCameraMovementMode.Classic
end

return CameraUtils


Prompt: -- Returns topmost ancestor in hierarchy descending from points folder

Response:
local function getTopAncestor(part)
	local prevParent = part
	local parent = part.Parent

	while not parent:IsA("Folder") do
		prevParent = parent
		parent = parent.Parent
	end

	return prevParent
end

local function getPositionRelativetoBase(part, pos)
	local basePlate = workspace:FindFirstChild("Baseplate")
	local basePosition = basePlate:GetChildren()[1].Position
	local baseSize = basePlate:GetChildren()[1].Size

	local posY = pos.Y
	local basePosY = basePosition.Y
	local baseSizeY = baseSize.Y
	return Vector3.new(pos.X, (basePosY + baseSizeY/2) + part.Size.Y/2, pos.Z)
end

local function breakModel(model)
	local children = model:GetChildren()

	for i,child in pairs(children) do
		-- Make part/model non-collidable
		if child:IsA("Model") then
			breakModel(child)
		elseif child:IsA("Part") then
			child.CanCollide = false
		end
	end
end


Prompt: --		ndAnim:Play()

Response:
		--wait(2)
	--end

	hum.Sit = false
	if newBAV ~= nil then newBAV:remove() end
	if newBP ~= nil then newBP:remove() end
	if newBV ~= nil then newBV:remove() end

	if newBG ~= nil then newBG.cframe = CFrame.new(torsoPosition, target*Vector3.new(1,0,1) + Vector3.new(0, torsoPosition.Y, 0) ) end
	if newBG ~= nil then newBG.maxTorque = Vector3.new(newBG.P, newBG.P, newBG.P) end
	spinSound:Stop()
	wait(.25)
	if newBG ~= nil then newBG:remove() end
end

local lastKeyDown = 0
local dashTime = 0
local lastSlash = 0
local amAnimating = false
function onActivated()
	vChar = Tool.Parent
	if vChar == nil then return end
	hum = vChar:FindFirstChild("Humanoid")
	if hum == nil then return end
	--if not Tool.Enabled then return end
	if amAnimating then return end
	Tool.Enabled = false
	amAnimating = true

	torso = vChar:FindFirstChild("Torso")
	if torso == nil then Tool.Enabled = true return end

	t = r.Stepped:wait()
	if t - dashTime < .2 then
		-- dash attack
		dashIt(hum, torso)
		wait(.5)  -- reload time
		amAnimating = false
	elseif t - lastSlash < .2 then
		-- slash attack
		slashIt(hum, torso)
		--wait(1)
		amAnimating = false
		--wait(.5)  -- reload time
	else
		-- normal attack
		whackSound:Play()
		lastSlash = t
		amAnimating = false -- here must be before the wait, to allow for double-clix
		wait(.5)
	end
	if not amAnimating then Tool.Enabled = true end
end

local keyConnection = nil
function onKeyDown(key)
	if key:lower() == "w" then
		t = r.Stepped:wait()
		if (t - lastKeyDown < .2) then dashTime = t end
		lastKeyDown = t
	end
end

function onEquippedLocal(mouse)
	slashSound.Volume = 1
	spinSound.Volume = 1
	whackSound.Volume = 1

	keyConnection = mouse.KeyDown:connect(onKeyDown)
end

function onUnequippedLocal()
	if keyConnection ~= nil then keyConnection:disconnect() end

	if newBV ~= nil then newBV:remove() end
	if newBG ~= nil then newBG:remove() end
	if newBAV ~= nil then newBAV:remove() end
	if newBP ~= nil then newBP:remove() end

	slashSound.Volume = 0
	spinSound.Volume = 0
	whackSound.Volume = 0
end

Tool.Equipped:connect(onEquippedLocal)
Tool.Unequipped:connect(onUnequippedLocal)
Tool.Activated:connect(onActivated)


Prompt: --// Services

Response:
local L_109_ = game:GetService('RunService').RenderStepped
local L_110_ = game:GetService('UserInputService')


Prompt: -- local Defaults = GuiLib:WaitForChild("Defaults")

Response:
local UIS = game:GetService("UserInputService")
local RUNSERVICE = game:GetService("RunService")


Prompt: -- // Main loop

Response:
for key, object in pairs(script:GetDescendants()) do
	if not object:IsA("Folder") then
		table.insert(assets, object)
	end
end


Prompt:
--The ignore list will fill up over time. This is how many seconds it will go before
--being refreshed in order to keep it from filling up with instances that aren't in
--the datamodel anymore.

Response:
local IGNORE_LIST_LIFETIME = 5

local MAX_BULLET_TIME = 10

local localRandom = Random.new()
local localPlayer = not IsServer and Players.LocalPlayer

local BulletWeapon = {}
BulletWeapon.__index = BulletWeapon
setmetatable(BulletWeapon, BaseWeapon)

BulletWeapon.CanAimDownSights = true
BulletWeapon.CanBeFired = true
BulletWeapon.CanBeReloaded = true
BulletWeapon.CanHit = true

function BulletWeapon.new(weaponsSystem, instance)
	local self = BaseWeapon.new(weaponsSystem, instance)
	setmetatable(self, BulletWeapon)

	self.usesCharging = false
	self.charge = 0
	self.chargeSoundPitchMin = 0.5
	self.chargeSoundPitchMax = 1

	self.triggerDisconnected = false
	self.startupFinished = false -- TODO: make startup time use a configuration value
	self.burstFiring = false
	self.burstIdx = 0
	self.nextFireTime = 0

	self.recoilIntensity = 0
	self.aimPoint = Vector3.new()

	self:addOptionalDescendant("tipAttach", "TipAttachment")

	self:addOptionalDescendant("boltMotor", "BoltMotor")
	self:addOptionalDescendant("boltMotorStart", "BoltMotorStart")
	self:addOptionalDescendant("boltMotorTarget", "BoltMotorTarget")

	self:addOptionalDescendant("chargeGlowPart", "ChargeGlow")
	self:addOptionalDescendant("chargeCompleteParticles", "ChargeCompleteParticles")
	self:addOptionalDescendant("dischargeCompleteParticles", "DischargeCompleteParticles")

	self:addOptionalDescendant("muzzleFlash0", "MuzzleFlash0")
	self:addOptionalDescendant("muzzleFlash1", "MuzzleFlash1")
	self:addOptionalDescendant("muzzleFlashBeam", "MuzzleFlash")

	self.hitMarkTemplate = HitMarksFolder:FindFirstChild(self:getConfigValue("HitMarkEffect", "BulletHole"))

	self.casingTemplate = CasingsFolder:FindFirstChild(self:getConfigValue("CasingEffect", ""))
	self:addOptionalDescendant("casingEjectPoint", "CasingEjectPoint")

	self.ignoreList = {}
	self.ignoreListRefreshTime = 0

	self:addOptionalDescendant("handAttach", "LeftHandAttachment")
	self.handAlignPos = nil
	self.handAlignRot = nil

	self.chargingParticles = {}
	self.instance.DescendantAdded:Connect(function(descendant)
		if descendant.Name == "ChargingParticles" and descendant:IsA("ParticleEmitter") then
			table.insert(self.chargingParticles, descendant)
		end
	end)
	for _, v in pairs(self.instance:GetDescendants()) do
		if v.Name == "ChargingParticles" and v:IsA("ParticleEmitter") then
			table.insert(self.chargingParticles, v)
		end
	end

	self:doInitialSetup()

	return self
end

function BulletWeapon:onEquippedChanged()
	BaseWeapon.onEquippedChanged(self)

	if not IsServer then
		if self.weaponsSystem.camera then
			if self.equipped then
				self.startupFinished = false
			end
		end

		if self.equipped then
			ContextActionService:BindAction("ReloadWeapon", function(...) self:onReloadAction(...) end, false, Enum.KeyCode.R, Enum.KeyCode.ButtonX)
		else
			ContextActionService:UnbindAction("ReloadWeapon")

			-- Stop charging/discharging sounds
			local chargingSound = self:getSound("Charging")
			local dischargingSound = self:getSound("Discharging")
			if chargingSound and chargingSound.Playing then
				chargingSound:Stop()
			end
			if dischargingSound and dischargingSound.Playing then
				dischargingSound:Stop()
			end
		end

		self.triggerDisconnected = false
	end
end

function BulletWeapon:onReloadAction(actionName, inputState, inputObj)
	if inputState == Enum.UserInputState.Begin and not self.reloading then
		self:reload()
	end
end

function BulletWeapon:animateBoltAction(isOpen)
	if not self.boltMotor or not self.boltMotorStart or not self.boltMotorTarget then
		return
	end

	if isOpen then
		self:tryPlaySound("BoltOpenSound")
	else
		self:tryPlaySound("BoltCloseSound")
	end

	local actionMoveTime = isOpen and self:getConfigValue("ActionOpenTime", 0.025) or self:getConfigValue("ActionCloseTime", 0.075)
	local targetCFrame = isOpen and self.boltMotorTarget.CFrame or self.boltMotorStart.CFrame

	local boltTween = TweenService:Create(self.boltMotor, TweenInfo.new(actionMoveTime, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut), { C0 = targetCFrame })
	boltTween:Play()
	boltTween.Completed:Wait()
end

function BulletWeapon:getRandomSeedForId(id)
	return id
end


Prompt: --model by CatLeoYT script--

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

Players = game:GetService("Players")

Sounds = {
	CoilSound = Handle:WaitForChild("CoilSound"),
}

Gravity = 196.20
JumpHeightPercentage = 0.4

ToolEquipped = false

function GetAllConnectedParts(Object)
	local Parts = {}
	local function GetConnectedParts(Object)
		for i, v in pairs(Object:GetConnectedParts()) do
			local Ignore = false
			for ii, vv in pairs(Parts) do
				if v == vv then
					Ignore = true
				end
			end
			if not Ignore then
				table.insert(Parts, v)
				GetConnectedParts(v)
			end
		end
	end
	GetConnectedParts(Object)
	return Parts
end

function SetGravityEffect()
	if not GravityEffect or not GravityEffect.Parent then
		GravityEffect = Instance.new("BodyForce")
		GravityEffect.Name = "GravityCoilEffect"
		GravityEffect.Parent = Torso
	end
	local TotalMass = 0
	local ConnectedParts = GetAllConnectedParts(Torso)
	for i, v in pairs(ConnectedParts) do
		if v:IsA("BasePart") then
			TotalMass = (TotalMass + v:GetMass())
		end
	end
	local TotalMass = (TotalMass * 196.20 * (1 - JumpHeightPercentage))
	GravityEffect.force = Vector3.new(0, TotalMass, 0)
end

function HandleGravityEffect(Enabled)
	if not CheckIfAlive() then
		return
	end
	for i, v in pairs(Torso:GetChildren()) do
		if v:IsA("BodyForce") then
			v:Destroy()
		end
	end
	for i, v in pairs({ToolUnequipped, DescendantAdded, DescendantRemoving}) do
		if v then
			v:disconnect()
		end
	end
	if Enabled then
		CurrentlyEquipped = true
		ToolUnequipped = Tool.Unequipped:connect(function()
			CurrentlyEquipped = false
		end)
		SetGravityEffect()
		DescendantAdded = Character.DescendantAdded:connect(function()
			wait()
			if not CurrentlyEquipped or not CheckIfAlive() then
				return
			end
			SetGravityEffect()
		end)
		DescendantRemoving = Character.DescendantRemoving:connect(function()
			wait()
			if not CurrentlyEquipped or not CheckIfAlive() then
				return
			end
			SetGravityEffect()
		end)
	end
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 Equipped(Mouse)
	Character = Tool.Parent
	Humanoid = Character:FindFirstChild("Humanoid")
	Torso = Character:FindFirstChild("Torso") or Character:FindFirstChild("UpperTorso")
	Player = Players:GetPlayerFromCharacter(Character)
	if not CheckIfAlive() then
		return
	end
	if HumanoidDied then
		HumanoidDied:disconnect()
	end
	HumanoidDied = Humanoid.Died:connect(function()
		if GravityEffect and GravityEffect.Parent then
			GravityEffect:Destroy()
		end
	end)
	Sounds.CoilSound:Play()
	HandleGravityEffect(true)
	ToolEquipped = true
end

function Unequipped()
	if HumanoidDied then
		HumanoidDied:disconnect()
	end
	HandleGravityEffect(false)
	ToolEquipped = false
end

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


Prompt: --[[Flip]]

Response:
function Flip()
	--Detect Orientation
	if (car.DriveSeat.CFrame*CFrame.Angles(math.pi/2,0,0)).lookVector.y > .1 or FlipDB then
		FlipWait=tick()

		--Apply Flip
	else
		if tick()-FlipWait>=3 then
			FlipDB=true
			local gyro = car.DriveSeat.Flip
			gyro.maxTorque = Vector3.new(10000,0,10000)
			gyro.P=3000
			gyro.D=500
			wait(1)
			gyro.maxTorque = Vector3.new(0,0,0)
			gyro.P=0
			gyro.D=0
			FlipDB=false
		end
	end
end


Prompt: -- Update camera if it changes

Response:
workspace.Changed:connect(function (p)
	if p == "CurrentCamera" then
		camera = workspace.CurrentCamera
	end
end)

coroutine.resume(coroutine.create(function()
game:GetService("RunService").Stepped:connect(function()

	Indicator:updateAll()
game:GetService("RunService").RenderStepped:wait()
end)
end))


Prompt: --[[[Default Controls]]

Response:
	--Peripheral Deadzones
	Tune.Peripherals = {
		MSteerWidth				= 67		,	-- Mouse steering control width	(0 - 100% of screen width)
		MSteerDZone				= 10		,	-- Mouse steering deadzone (0 - 100%)

		ControlLDZone			= 5			,	-- Controller steering L-deadzone (0 - 100%)
		ControlRDZone			= 5			,	-- Controller steering R-deadzone (0 - 100%)
	}

	--Control Mapping
	Tune.Controls = {

	--Keyboard Controls
		--Mode Toggles
		ToggleTransMode			= Enum.KeyCode.M					,

		--Primary Controls
		Throttle				= Enum.KeyCode.Up					,
		Brake					= Enum.KeyCode.Down					,
		SteerLeft				= Enum.KeyCode.Left					,
		SteerRight				= Enum.KeyCode.Right				,
		ToggleTCS				= Enum.KeyCode.T					,
		ToggleABS				= Enum.KeyCode.B					,

		--Secondary Controls
		Throttle2				= Enum.KeyCode.W					,
		Brake2					= Enum.KeyCode.S					,
		SteerLeft2				= Enum.KeyCode.A					,
		SteerRight2				= Enum.KeyCode.D					,

		--Manual Transmission
		ShiftUp					= Enum.KeyCode.E					,
		ShiftDown				= Enum.KeyCode.Q					,
		Clutch					= Enum.KeyCode.LeftShift			,

		--Handbrake
		PBrake					= Enum.KeyCode.P					,

	--Mouse Controls
		MouseThrottle			= Enum.UserInputType.MouseButton1	,
		MouseBrake				= Enum.UserInputType.MouseButton2	,
		MouseClutch				= Enum.KeyCode.W					,
		MouseShiftUp			= Enum.KeyCode.E					,
		MouseShiftDown			= Enum.KeyCode.Q					,
		MousePBrake				= Enum.KeyCode.LeftShift			,

	--Controller Mapping
		ContlrThrottle			= Enum.KeyCode.ButtonR2				,
		ContlrBrake				= Enum.KeyCode.ButtonL2				,
		ContlrSteer				= Enum.KeyCode.Thumbstick1			,
		ContlrShiftUp			= Enum.KeyCode.ButtonY				,
		ContlrShiftDown			= Enum.KeyCode.ButtonX				,
		ContlrClutch			= Enum.KeyCode.ButtonR1				,
		ContlrPBrake			= Enum.KeyCode.ButtonL1				,
		ContlrToggleTMode		= Enum.KeyCode.DPadUp				,
		ContlrToggleTCS			= Enum.KeyCode.DPadDown				,
		ContlrToggleABS			= Enum.KeyCode.DPadRight			,
	}


Prompt: -- / Settings / --

Response:
local Settings = {
	OnCD = false
}


Prompt:
---////==========================================\\\---
--Controller for: Korean Arrow Display

Response:
SignalLeft = script.InvertDirection.Value and script.Parent.Parent.Parent.ControlBox.IsOnRight or script.Parent.Parent.Parent.ControlBox.IsOnLeft
SignalRight = script.InvertDirection.Value and script.Parent.Parent.Parent.ControlBox.IsOnLeft or script.Parent.Parent.Parent.ControlBox.IsOnRight


Prompt:
-- FIXME: Capture this as a local variable before returning, else a luau bug
-- prevents __call from being understood: https://jira.rbx.com/browse/CLI-40294

Response:
local interface = setmetatable(RegExp, {
	__call = new,
})

return interface


Prompt:
---////==========================================\\\---
--Controller for: 2-Way Railroad Crossing Lights

Response: Signal = script.Parent.Parent.Parent.ControlBox.CrossingValues.CrossingSignals


Prompt: --//Variables--

Response:
local player = game:GetService("Players").LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()


Prompt: -- Initialization

Response:
for _, child in ipairs(Storage:GetChildren()) do
	table.insert(Buffer, child)
end


Prompt:
-- ================================================================================
-- VARIABLES
-- ================================================================================
-- Services

Response:
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local GuiService = game:GetService("GuiService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local IS_CONSOLE = GuiService:IsTenFootInterface()
local IS_MOBILE = UserInputService.TouchEnabled and not UserInputService.MouseEnabled and not IS_CONSOLE

local GAMEPAD_DEADZONE = 0.1


Prompt: --[[Transmission]]

Response:
	Tune.TransModes		= {"Auto"}								--[[
	[Modes]
		"Auto"		: Automatic shifting
		"Semi"		: Clutchless manual shifting, dual clutch transmission
		"Manual"	: Manual shifting with clutch

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

	--Automatic Settings
	Tune.AutoShiftMode	= "RPM"												--[[
	[Modes]
		"Speed"		: Shifts based on wheel speed
		"RPM"		: Shifts based on RPM											]]
	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)

	--Gear Ratios
	Tune.FinalDrive		= 4.60		 --	[TRANSMISSION CALCULATIONS FOR NERDS]
	Tune.Ratios			= {			 --		SPEED [SPS]	 = (Wheel diameter(studs) * pi(3.14) * RPM) / (60 * Gear Ratio * Final Drive * Multiplier)
		--[[Reverse]]	3.484		,--		WHEEL TORQUE = Engine Torque * Gear Ratio * Final Drive * Multiplier
		--[[Neutral]]	0			,
		--[[ 1 ]]		3.587      	,
		--[[ 2 ]]		2.022		,
		--[[ 3 ]]		1.384		,
		--[[ 4 ]]		1.000		,
		--[[ 5 ]]		0.861		,
		--[[ 6 ]]		0.621		,
	}
	Tune.FDMult			= 1.7			-- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)


Prompt: -- Configuration

Response:
local maxCharacters = 500
local defaultText = "Type your feedback here"


Prompt:
--[=[
	Convert percentVisible observable to transparency

	@function toTransparency
	@param source Observable<number>
	@return Observable<number>
	@within BasicPaneUtils
]=]

Response:
BasicPaneUtils.toTransparency = Rx.map(function(value)
	return 1 - value
end)


Prompt: --[[Transmission]]

Response:
	Tune.TransModes		= {"Auto","Semi"}												--[[
	[Modes]
		"Auto"		: Automatic shifting
		"Semi"		: Clutchless manual shifting, dual clutch transmission
		"Manual"	: Manual shifting with clutch

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

	--Automatic Settings
	Tune.AutoShiftMode	= "Speed"												--[[
	[Modes]
		"Speed"		: Shifts based on wheel speed
		"RPM"		: Shifts based on RPM											]]
	Tune.AutoUpThresh	= -3200		-- Automatic upshift point 	(relative to peak RPM, positive = Over-rev)
	Tune.AutoDownThresh = 2400		-- Automatic downshift point (relative to peak RPM, positive = Under-rev)
	Tune.ShiftTime = .05				-- The time delay in which you initiate a shift and the car changes gear

	--Gear Ratios
	Tune.FinalDrive		= 2.9
	Tune.Ratios			= {
		--[[Reverse]]	4.29			,
		--[[Neutral]]	0			,
		--[[ 1 ]]		4.71			,
		--[[ 2 ]]		3.14		,
		--[[ 3 ]]		2.10		,
		--[[ 4 ]]		1.67		,
		--[[ 5 ]]		1.29		,
		--[[ 6 ]]		1.00			,
		--[[ 7 ]]		0.84			,
	}
	Tune.FDMult			= 1.00			-- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)


Prompt: --Automatic Gauge Scaling

Response:
if autoscaling then
	local Drive={}
	if _Tune.Config == "FWD" or _Tune.Config == "AWD" then
		if car.Wheels:FindFirstChild("FL")~= nil then
			table.insert(Drive,car.Wheels.FL)
		end
		if car.Wheels:FindFirstChild("FR")~= nil then
			table.insert(Drive,car.Wheels.FR)
		end
		if car.Wheels:FindFirstChild("F")~= nil then
			table.insert(Drive,car.Wheels.F)
		end
	end
	if _Tune.Config == "RWD" or _Tune.Config == "AWD" then
		if car.Wheels:FindFirstChild("RL")~= nil then
			table.insert(Drive,car.Wheels.RL)
		end
		if car.Wheels:FindFirstChild("RR")~= nil then
			table.insert(Drive,car.Wheels.RR)
		end
		if car.Wheels:FindFirstChild("R")~= nil then
			table.insert(Drive,car.Wheels.R)
		end
	end

	local wDia = 0
	for i,v in pairs(Drive) do
		if v.Size.x>wDia then wDia = v.Size.x end
	end
	Drive = nil
	for i,v in pairs(UNITS) do
		v.maxSpeed = math.ceil(v.scaling*wDia*math.pi*_lRPM/60/_Tune.Ratios[#_Tune.Ratios]/_Tune.FinalDrive)
		v.spInc = math.max(math.ceil(v.maxSpeed/200)*20,20)
	end
end

for i=0,revEnd*2 do
	local ln = script.Parent.ln:clone()
	ln.Parent = script.Parent.Tach
	ln.Rotation = 45 + i * 225 / (revEnd*2)
	ln.Num.Text = i/2
	ln.Num.Rotation = -ln.Rotation
	if i*500>=math.floor(_pRPM/500)*500 then
		ln.Frame.BackgroundColor3 = Color3.new(1,0,0)
		if i<revEnd*2 then
			ln2 = ln:clone()
			ln2.Parent = script.Parent.Tach
			ln2.Rotation = 45 + (i+.5) * 225 / (revEnd*2)
			ln2.Num:Destroy()
			ln2.Visible=true
		end
	end
	if i%2==0 then
		ln.Frame.Size = UDim2.new(0,3,0,10)
		ln.Frame.Position = UDim2.new(0,-1,0,100)
		ln.Num.Visible = true
	else
		ln.Num:Destroy()
	end
	ln.Visible=true
end

local lns = Instance.new("Frame",script.Parent.Speedo)
lns.Name = "lns"
lns.BackgroundTransparency = 1
lns.BorderSizePixel = 0
lns.Size = UDim2.new(0,0,0,0)
for i=1,90 do
	local ln = script.Parent.ln:clone()
	ln.Parent = lns
	ln.Rotation = 45 + 225*(i/90)
	if i%2==0 then
		ln.Frame.Size = UDim2.new(0,2,0,10)
		ln.Frame.Position = UDim2.new(0,-1,0,100)
	else
		ln.Frame.Size = UDim2.new(0,3,0,5)
	end
	ln.Num:Destroy()
	ln.Visible=true
end

for i,v in pairs(UNITS) do
	local lnn = Instance.new("Frame",script.Parent.Speedo)
	lnn.BackgroundTransparency = 1
	lnn.BorderSizePixel = 0
	lnn.Size = UDim2.new(0,0,0,0)
	lnn.Name = v.units
	if i~= 1 then lnn.Visible=false end

	for i=0,v.maxSpeed,v.spInc do
		local ln = script.Parent.ln:clone()
		ln.Parent = lnn
		ln.Rotation = 45 + 225*(i/v.maxSpeed)
		ln.Num.Text = i
		ln.Num.TextSize = 14
		ln.Num.Rotation = -ln.Rotation
		ln.Frame:Destroy()
		ln.Num.Visible=true
		ln.Visible=true
	end
end

if 	script.Parent.Parent.IsOn.Value then
	script.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
end

script.Parent.Parent.IsOn.Changed:connect(function()
	if script.Parent.Parent.IsOn.Value then
		script.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
	end
end)

script.Parent.Parent.Values.RPM.Changed:connect(function()
	script.Parent.Tach.Needle.Rotation = 45 + 225 * math.min(1,script.Parent.Parent.Values.RPM.Value / (revEnd*1000))
end)

script.Parent.Parent.Values.Gear.Changed:connect(function()
	local gearText = script.Parent.Parent.Values.Gear.Value
	if gearText == 0 then gearText = "N"
	elseif gearText == -1 then gearText = "R"
	end
	script.Parent.Gear.Text = gearText
end)

script.Parent.Parent.Values.TCS.Changed:connect(function()
	if _Tune.TCSEnabled then
		if script.Parent.Parent.Values.TCS.Value then
			script.Parent.TCS.TextColor3 = Color3.new(1,170/255,0)
			script.Parent.TCS.TextStrokeColor3 = Color3.new(1,170/255,0)
			if script.Parent.Parent.Values.TCSActive.Value then
				wait()
				script.Parent.TCS.Visible = not script.Parent.TCS.Visible
			else
				wait()
				script.Parent.TCS.Visible = false
			end
		else
			script.Parent.TCS.Visible = true
			script.Parent.TCS.TextColor3 = Color3.new(1,0,0)
			script.Parent.TCS.TextStrokeColor3 = Color3.new(1,0,0)
		end
	else
		script.Parent.TCS.Visible = false
	end
end)

script.Parent.Parent.Values.TCSActive.Changed:connect(function()
	if _Tune.TCSEnabled then
		if script.Parent.Parent.Values.TCSActive.Value and script.Parent.Parent.Values.TCS.Value then
			wait()
			script.Parent.TCS.Visible = not script.Parent.TCS.Visible
		elseif not script.Parent.Parent.Values.TCS.Value then
			wait()
			script.Parent.TCS.Visible = true
		else
			wait()
			script.Parent.TCS.Visible = false
		end
	else
		script.Parent.TCS.Visible = false
	end
end)

script.Parent.TCS.Changed:connect(function()
	if _Tune.TCSEnabled then
		if script.Parent.Parent.Values.TCSActive.Value and script.Parent.Parent.Values.TCS.Value then
			wait()
			script.Parent.TCS.Visible = not script.Parent.TCS.Visible
		elseif not script.Parent.Parent.Values.TCS.Value then
			wait()
			script.Parent.TCS.Visible = true
		end
	else
		if script.Parent.TCS.Visible then
			script.Parent.TCS.Visible = false
		end
	end
end)


Prompt: -- NOTE: there is some value-specific code that involves VARARG_NEEDSARG

Response:
luaY.VARARG_NEEDSARG = 4

luaY.LUA_MULTRET = -1  -- (lua.h)


Prompt:
--					if GetHitPlayers() >= 3 then
--						AwardBadge:Invoke(FiredPlayer,"Explosive Results")
--					end

Response:
					local FiredPlayer = ReflectedPlayer or FiredPlayer
					local DoDamage = PlayerDamager:CanDamageHumanoid(FiredPlayer,HitHumanoid)
					if DoDamage then
						local DamageFraction = 0
						if RadiusFromBlast < BLAST_RADIUS/2 then
							DamageFraction = 1
						elseif RadiusFromBlast < BLAST_RADIUS then
							DamageFraction = 1 - (RadiusFromBlast - BLAST_RADIUS/2)/(BLAST_RADIUS/2)
						end

						if HitPlayer == FiredPlayer and DamageFraction == 1 then
							HitHumanoid.Health = 0
						else
							PlayerDamager:DamageHumanoid(FiredPlayer,HitHumanoid,50 + (DamageFraction * 50),DamageName)
						end
					end
				end
			end

			--Break joints if it isn't a character.
			if BreakJoints then
				ExplosionTouchPart:BreakJoints()
			end

			--If the part is able to fade with explosions, signal it to fade.


Prompt:
--[[
	This is a simple signal implementation that has a dead-simple API.

		local signal = createSignal()

		local disconnect = signal:subscribe(function(foo)
			print("Cool foo:", foo)
		end)

		signal:fire("something")

		disconnect()
]]

Response:
local function addToMap(map, addKey, addValue)
	local new = {}

	for key, value in pairs(map) do
		new[key] = value
	end

	new[addKey] = addValue

	return new
end

local function removeFromMap(map, removeKey)
	local new = {}

	for key, value in pairs(map) do
		if key ~= removeKey then
			new[key] = value
		end
	end

	return new
end

local function createSignal()
	local connections = {}

	local function subscribe(_, callback)
		assert(typeof(callback) == "function", "Can only subscribe to signals with a function.")

		local connection = {
			callback = callback,
		}

		connections = addToMap(connections, callback, connection)

		local function disconnect()
			assert(not connection.disconnected, "Listeners can only be disconnected once.")

			connection.disconnected = true
			connections = removeFromMap(connections, callback)
		end

		return disconnect
	end

	local function fire(_, ...)
		for callback, connection in pairs(connections) do
			if not connection.disconnected then
				callback(...)
			end
		end
	end

	return {
		subscribe = subscribe,
		fire = fire,
	}
end

return createSignal


Prompt: -- MODULES --

Response: local ragdollBuilder = require(script.RagdollBuilder)


Prompt: -- Update the effect on every single frame.

Response: RunService.RenderStepped:Connect(updateBobbleEffect)


Prompt: --brownUI = Color3.fromRGB(230, 191, 157),

Response:
essenceYellow = Color3.fromRGB(255, 255, 111),

badRed = Color3.fromRGB(255, 0, 0),
fadedBadRed = Color3.fromRGB(129, 0, 0),
uncooked = Color3.fromRGB(195, 116, 116),

goodGreen = Color3.fromRGB(170, 255, 0),
fadedGoodGreen = Color3.fromRGB(106, 129, 58),

grey200 = Color3.fromRGB(200,200,200),
ironGrey = Color3.fromRGB(200, 190, 181),

steel = Color3.fromRGB(106, 97, 84),

mojoPurp = Color3.fromRGB(222, 147, 223)

}

return module


Prompt: -- It's important we update all icons when a players language changes to account for changes in the width of text, etc

Response:
task.spawn(function()
	local LocalizationService = game:GetService("LocalizationService")
	local success, translator = pcall(function() return LocalizationService:GetTranslatorForPlayerAsync(localPlayer) end)
	local function updateAllIcons()
		local icons = IconController.getIcons()
		for _, icon in pairs(icons) do
			icon:_updateAll()
		end
	end
	if success then
		translator:GetPropertyChangedSignal("LocaleId"):Connect(updateAllIcons)
		task.delay(1, updateAllIcons)
		task.delay(10, updateAllIcons)
	end
end)

return IconController


Prompt: --Check moderation data

Response:
game.Players.PlayerAdded:Connect(function(plr)

	--Kick new players if game is shutting down
	if shuttingDown then
		plr:Kick("This server has shut down.")
	end

	--Kick banned players, or remove ban data if ban time is over
	local banSuccess, banData = pcall(function()
		local data = ds:GetAsync(plr.UserId .. "Banned")
		return data
	end)

	if banSuccess and banData then
		local banEnd = banData[1]

		if os.time() >= banEnd then
			pcall(function()
				ds:RemoveAsync(plr.UserId .. "Banned")
			end)

		else
			local banReason = banData[2]

			local dateInfo = os.date("!*t", banEnd)
			local dateFormatted = dateInfo["day"] .. "/" .. dateInfo["month"] .. "/" .. dateInfo["year"] .. "  " .. dateInfo["hour"] .. ":" .. dateInfo["min"] .. ":" .. dateInfo["sec"]
			local banMessage = "Banned for: " .. banReason .. " | Ends: " .. dateFormatted

			plr:Kick(banMessage)
		end
	end

	--Mute players or unmute them if mute time is over
	local muteSuccess, muteData = pcall(function()
		local data = ds:GetAsync(plr.UserId .. "Muted")
		return data
	end)

	if muteSuccess and muteData then
		local muteEnd = muteData[1]

		if os.time() >= muteEnd then
			pcall(function()
				ds:RemoveAsync(plr.UserId .. "Muted")
			end)

		else
			channel:MuteSpeaker(plr.Name)

			local timeToUnmute = muteEnd - os.time()
			task.wait(timeToUnmute)

			if plr then
				channel:UnmuteSpeaker(plr.Name)
			end
		end
	end
end)


Prompt: ----- hot tap handler -----

Response:
hotTap.Interactive.ClickDetector.MouseClick:Connect(function()
	if hotOn.Value == false then
		hotOn.Value = true
		faucet.ParticleEmitter.Enabled = true
		waterSound:Play()
		hotTap:SetPrimaryPartCFrame(hotTap.PrimaryPart.CFrame * CFrame.Angles(0, math.rad(45), 0))
	else
		hotOn.Value = false
		if coldOn.Value == false then
			faucet.ParticleEmitter.Enabled = false
			waterSound:Stop()
		end
		hotTap:SetPrimaryPartCFrame(hotTap.PrimaryPart.CFrame * CFrame.Angles(0, math.rad(-45), 0))
	end
end)


Prompt:
--[[
	ETC
]]

Response:
local random = Random.new()
local EventData = ReplicatedStorage.Events.EventData
EventData.OnServerEvent:Connect(function(player, cmd, ...)
	if cmd == "SpectatePlayer" then
		local playerToSpectate = ...
		if not Util.playerIsAlive(player) and Util.playerIsAlive(playerToSpectate) then
			player.ReplicationFocus = playerToSpectate.Character.Head
		end
	end
end)

local RespawnEvent = ReplicatedStorage.Events.RespawnEvent
RespawnEvent.Event:Connect(function(player)
	if gameStageHandler.currentStageClassName == "Gameplay" and player and player.Character then
		wait(Conf.respawnTime)
		if not Util.playerIsAlive(player) then
			-- Save all player's weapon names to give them new instances of them when they respawn
			local toolNamesBeforeDeath = {}
			for _, instance in pairs(player.Backpack:GetChildren()) do
				if instance:IsA("Tool") and ReplicatedStorage.Assets.Weapons:FindFirstChild(instance.Name) then
					table.insert(toolNamesBeforeDeath, instance.Name)
				end
			end

			local characterAddedConn = nil
			characterAddedConn = player.CharacterAdded:Connect(function(character)
				characterAddedConn:Disconnect()

				-- Wait a frame for the character to initialize/spawn
				RunService.Heartbeat:Wait()

				-- Add weapons the player had before dying to their backpack
				for _, weaponName in ipairs(toolNamesBeforeDeath) do
					local weaponTemplate = ReplicatedStorage.Assets.Weapons:FindFirstChild(weaponName)
					if weaponTemplate ~= nil then
						weaponTemplate:Clone().Parent = player.Backpack
					end
				end

				-- Set up the player's character when they respawn
				local head = character:WaitForChild("Head")
				-- Calculate where to spawn player based on storm's current target position/radius
				local targetPos, targetRadius = ShrinkingBarrier.getNextPositionAndRadius()
				local randomRadius = targetRadius * random:NextNumber(Conf.respawn_radius_lowest_fraction, Conf.respawn_radius_highest_fraction)
				local randomRadians = random:NextNumber(0, 2 * math.pi)
				if Conf.num_teams == 2 then
					-- In team mode, make players spawn only on their team's half of the map
					local dividingAngle = ShrinkingBarrier.getDividingAngle()
					if PlayerMatchInfo.GetField(player, "teamNumber") == 1 then
						randomRadians = random:NextNumber(dividingAngle - math.pi, dividingAngle)
					else
						randomRadians = random:NextNumber(dividingAngle, dividingAngle + math.pi)
					end
				end
				local xSpawn = targetPos.X + randomRadius * math.cos(randomRadians)
				local ySpawn = targetPos.Y + Conf.respawn_height_fraction * Conf.delivery_vehicle_spawn_height
				local zSpawn = targetPos.Z + randomRadius * math.sin(randomRadians)
				head.CFrame = CFrame.new(xSpawn, ySpawn, zSpawn)
				player.ReplicationFocus = head
			end)
			Util.loadCharacter(player)
		end
	end
end)

if not PingHandler.doingSetup and not PingHandler.didSetup then
	PingHandler.setup()
end


Prompt: -- connect events

Response:
Humanoid.Died:connect(onDied)
Humanoid.Running:connect(onRunning)
Humanoid.Jumping:connect(onJumping)
Humanoid.Climbing:connect(onClimbing)
Humanoid.GettingUp:connect(onGettingUp)
Humanoid.FreeFalling:connect(onFreeFall)
Humanoid.FallingDown:connect(onFallingDown)
Humanoid.Seated:connect(onSeated)
Humanoid.PlatformStanding:connect(onPlatformStanding)
Humanoid.Swimming:connect(onSwimming)


Prompt: --returns the wielding player of this tool

Response:
function getPlayer()
	local char = Tool.Parent
	return game:GetService("Players"):GetPlayerFromCharacter(Character)
end

function Toss(direction)
	local handlePos = Vector3.new(Tool.Handle.Position.X, 0, Tool.Handle.Position.Z)
	local spawnPos = Character.Head.Position
	spawnPos  = spawnPos + (direction * 5)
	Tool.Handle.Transparency = 1

	local Object = Tool.Handle:Clone()
	Object.Parent = workspace
	Object.Transparency = 0
	Object.CanCollide = true
	Object.Server.Disabled = false
	Object.Stabilize.Disabled = false
	Object.Interface.Enabled = true

	Object.CFrame = Tool.Handle.CFrame
	Object.Velocity = (direction*AttackVelocity) + Vector3.new(0,AttackVelocity/7.5,0)
	local rand = 11.25
	Object.RotVelocity = Vector3.new(math.random(-rand,rand),math.random(-rand,rand),math.random(-rand,rand))
	Object:SetNetworkOwner(getPlayer())

	local tag = Instance.new("ObjectValue")
	tag.Value = getPlayer()
	tag.Name = "creator"
	tag.Parent = Object
	Tool:Destroy()
end

script.Parent.Power.OnServerEvent:Connect(function(player, Power)
	AttackVelocity = Power
end)

Remote.OnServerEvent:Connect(function(player, mousePosition)
	if not AttackAble then return end
	AttackAble = false
	if Humanoid and Humanoid.RigType == Enum.HumanoidRigType.R15 then
		Remote:FireClient(getPlayer(), "PlayAnimation", "Animation")
	end
	local targetPos = mousePosition.p
	local lookAt = (targetPos - Character.Head.Position).unit
	Toss(lookAt)
	LeftDown = true
end)

function onLeftUp()
	LeftDown = false
end

Tool.Equipped:Connect(function()
	Character = Tool.Parent
	Humanoid = Character:FindFirstChildOfClass("Humanoid")
end)

Tool.Unequipped:Connect(function()
	Character = nil
	Humanoid = nil
end)


Prompt: -- The core 'ProcessReceipt' callback function

Response:
local function processReceipt(receiptInfo)

	-- Determine if the product was already granted by checking the data store
	local playerProductKey = receiptInfo.PlayerId .. "_" .. receiptInfo.PurchaseId
	local purchased = false
	local success, errorMessage = pcall(function()
		purchased = purchaseHistoryStore:GetAsync(playerProductKey)
	end)
	-- If purchase was recorded, the product was already granted
	if success and purchased then
		return Enum.ProductPurchaseDecision.PurchaseGranted
	end

	-- Find the player who made the purchase in the server
	local player = Players:GetPlayerByUserId(receiptInfo.PlayerId)
	if not player then
		-- The player probably left the game
		-- If they come back, the callback will be called again
		return Enum.ProductPurchaseDecision.NotProcessedYet
	end

	-- Look up handler function from 'productFunctions' table above
    local handler =_G.HandlePurchase

	-- Call the handler function and catch any errors
    local success, result = pcall(handler, receiptInfo, receiptInfo.PlayerId)
	if not success or not result then
		warn("Error occurred while processing a product purchase")
		print("\nProductId:", receiptInfo.ProductId)
        print("\nPlayer:", player)

        _G.FinishedPurchase(receiptInfo.PlayerId,0,false)

		return Enum.ProductPurchaseDecision.NotProcessedYet
	end

	-- Record transaction in data store so it isn't granted again
	local success, errorMessage = pcall(function()
		purchaseHistoryStore:SetAsync(playerProductKey, true)
	end)
	if not success then
		error("Cannot save purchase data: " .. errorMessage)
	end

	-- IMPORTANT: Tell Roblox that the game successfully handled the purchase
	return Enum.ProductPurchaseDecision.PurchaseGranted
end


Prompt: --for i, model in pairs(GameFolder) do

Response:
	--ContentProvider:PreloadAsync({model})
	--Loaded += 1
	--Gui.Frame.TextLabel.Text = Loaded.."/"..toLoad.. " asset loaded"


Prompt: --- RUNTIME ---

Response:
while true do
    -- Get closest character head
    ClosestHead = nil
	ClosestDistance = MaxDistance
	CharacterHeads = {}
	for _, Character in pairs(workspace.Characters:GetChildren()) do
		if Character:IsA("Model") and Character:FindFirstChild("Head") then
			table.insert(CharacterHeads, Character.Head)
		end
	end

	for _, Head in pairs(CharacterHeads) do
		Distance = (Head.Position - NPCHead.Position).Magnitude

		if Distance < ClosestDistance then
			ClosestDistance = Distance
			ClosestHead = Head
		end
	end

    -- Look at closest character head or reset to original position if none found
	if ClosestHead ~= nil then
		-- Look at
		TweenService:Create(NPCHead, TweenInfo.new(0.5), {CFrame=lookAt(NPCHead.Position, ClosestHead.Position)}):Play()
    else
		TweenService:Create(NPCHead, TweenInfo.new(0.5), {CFrame=OriginalHeadCF}):Play()
    end

	wait()
end


Prompt: -- Connect the toggle function to the button's clicked event

Response: textButton.MouseButton1Click:Connect(toggleFrames)


Prompt: --script.Parent.Parent.Mover2.part.Anchored = true

Response:
script.Parent.Parent.Mover2.part.PrismaticConstraint.Speed = 0
script.Parent.Parent.Mover2.part.PrismaticConstraint.TargetPosition = script.Parent.Parent.Mover1.part.PrismaticConstraint.CurrentPosition
script.Parent.Parent.Right.BrickColor = BrickColor.new("Black")
script.Parent.Parent.Plays.Time.Disabled = true
script.Parent.Parent.Plays.SurfaceGui.TextLabel.Text = "00"
script.Parent.Parent.Configuration.Drop.Value = true
wait(1)
script.Parent.Parent.Grabber.Claw.Drop.Disabled = false
script.Disabled = true
end
end
end
script.Parent.ClickDetector.MouseClick:Connect(onClicked)


Prompt:
--[[**
	ensures value is a number and non-NaN

	@param value The value to check against

	@returns True iff the condition is satisfied, false otherwise
**--]]

Response:
function t.number(value)
	local valueType = typeof(value)
	if valueType == "number" then
		if value == value then
			return true
		else
			return false
		end
	else
		return false
	end
end


Prompt: --//Setup//--

Response:
local Chunks = game.Workspace.Chunks

local Seed = math.random(1, 10e6)


Prompt: --[[Engine]]

Response:
	--		[TORQUE CURVE VISUAL]
	--		Gas Engine: https://www.desmos.com/calculator/nap6stpjqf
	--		Electric Engine: https://www.desmos.com/calculator/ion9q7zp9t
	--		Use sliders to manipulate values
	--		Edit everything as if your car is NATURALLY aspirated, or as if it lacks a turbo.

	Tune.Engine 		= true		-- Enables or disables gas engine
									-- TORQUE CURVE: https://www.desmos.com/calculator/nap6stpjqf

	Tune.Horsepower		= 325
	Tune.IdleRPM		= 700
	Tune.PeakRPM		= 6000
	Tune.Redline		= 6500
	Tune.EqPoint		= 5252
	Tune.PeakSharpness	= 20
	Tune.CurveMult		= 0.2

	Tune.Electric		= false		-- Enables or disables electric engine
									-- TORQUE CURVE: https://www.desmos.com/calculator/ion9q7zp9t

	Tune.ElecHorsepower		= 223
	Tune.ElecMaxTorque		= 173

	Tune.ElecTransition1	= 4000
	Tune.ElecHpFrontMult	= 0.15

	Tune.ElecTransition2	= 9000
	Tune.ElecHpEndMult		= 2.9
	Tune.ElecHpEndPercent	= 10
	Tune.ElecTqEndMult		= 1.5
	Tune.ElecTqEndPercent	= 27

	Tune.ElecRedline		= 16000

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

	--Turbo Settings
	Tune.Aspiration		= "Single"												--[[
	[Aspiration]
		"Natural"		: N/A, Naturally aspirated engine
		"Single"		: Single turbocharger
		"Double"		: Twin turbocharger
		"Super"			: Supercharger												]]

	Tune.Boost			= 5			-- Max PSI (If you have two turbos and this is 15, the PSI will be 30)
	Tune.TurboSize		= 80		-- Turbo size; the bigger it is, the more lag it has.
	Tune.CompressRatio	= 6			-- The compression ratio (look it up)
	Tune.Sensitivity	= 0.05		-- How quickly the Supercharger (if appllied) will bring boost when throttle is applied. (Increment applied per tick, suggested values from 0.05 to 0.1)

	--Misc
	Tune.RevAccel		= 250		-- RPM acceleration when clutch is off
	Tune.RevDecay		= 75		-- RPM decay when clutch is off
	Tune.RevBounce		= 500		-- RPM kickback from redline
	Tune.IdleThrottle	= 3			-- Percent throttle at idle
	Tune.Flywheel		= 500		-- Flywheel weight (higher = faster response, lower = more stable RPM)


Prompt: -- Save next to a local variable for better performance

Response:
local next = next

local isServer = RunService:IsServer()

local ADDED_OBJECT = "ADDED_OBJECT_CHANGE_TYPE"
local REMOVED_OBJECT = "REMOVED_OBJECT_CHANGE_TYPE"

local DEBUG = false

local ContentsManager = {}
ContentsManager.__index = ContentsManager

function ContentsManager.new(grid, folder, masterContentsManager)
	local newContentsManager = {}
	newContentsManager.contents = {}
	newContentsManager.grid = grid
	newContentsManager.masterContentsManager = masterContentsManager
	newContentsManager.connections = {}
	newContentsManager.contentsListenerCount = 0
	newContentsManager.contentsListeners = {}
	setmetatable(newContentsManager, ContentsManager)

	if type(folder) == "string" then
		newContentsManager.folder = Instance.new("Folder")
		newContentsManager.folder.Name = folder
		newContentsManager.folder.Parent = game.Workspace
	else
		newContentsManager.folder = folder

		for _, child in ipairs(newContentsManager.folder:GetChildren()) do
			newContentsManager:_onChildAddedToContentsFolder(child)
		end
		newContentsManager.connections.objectAddedToContentsFolder =
			newContentsManager.folder.ChildAdded:Connect(function(childAdded)
				newContentsManager:_onChildAddedToContentsFolder(childAdded)
			end)
	end

	if masterContentsManager then
		masterContentsManager:addContentsListener(function(change)
			newContentsManager:_onMasterContentsChanged(change)
		end)
	end

	return newContentsManager
end

local function Vector3FromString(str)
	local vector3Values = {}
	for num in str:gmatch("[^,]+") do
		table.insert(vector3Values, tonumber(num))
	end

	return Vector3.new(vector3Values[1], vector3Values[2], vector3Values[3])
end

function ContentsManager:_onChildAddedToContentsFolder(child)
	local childName = child.Name
	local objectTypeName = string.sub(childName, 1, string.find(childName, "|") - 1)
	local objectType = self.grid.objectTypes[objectTypeName]
	if objectType then
		local _, _, _, cellName = objectType.fromString(childName)

		self:add(objectType, self:_allocateCell(Vector3FromString(cellName)).id, child, true)
	else
		warn("Child with improper name " .. child.Name .. " added to contents folder")
	end
end

function ContentsManager:addContentsListener(func)
	if not self.contentsListeners[func] then
		self.contentsListeners[func] = true
		self.contentsListenerCount = self.contentsListenerCount + 1
	end
end

function ContentsManager:removeContentsListener(func)
	if self.contentsListener[func] then
		self.contentsListener[func] = nil
		self.contentsListenerCount = self.contentsListenerCount - 1
	end
end

function ContentsManager:_onMasterContentsChanged(change)
	-- TODO: Remove conflicting temp objects and
	-- temp objects that are no longer connected to the rest of the structure

	if change.type == ADDED_OBJECT then
		self:remove(change.objectType, tostring(change.cellId))
	elseif change.type == REMOVED_OBJECT then
		self:remove(change.objectType, tostring(change.cellId), true, change.doNotDestroy)
	else
		error("Received master contents change with invalid type")
	end
end

function ContentsManager:canPlace(objectType, cellId)
	return self:_spaceAvailable(objectType, cellId) and self:_connected(objectType, cellId)
end

function ContentsManager:_spaceAvailable(objectType, cellId)
	local masterSpaceAvailable = true
	if self.masterContentsManager then
		masterSpaceAvailable = self.masterContentsManager:_spaceAvailable(objectType, cellId)
	end

	local spaceAvailable = not bit32.btest(objectType.occupancy, self:getCell(cellId).occupancy)

	return masterSpaceAvailable and spaceAvailable
end

function ContentsManager:getCell(cellId)
	local cell = self.contents[tostring(cellId)]
	if cell then
		return cell
	end

	return Cell.new(self.grid, cellId)
end

function ContentsManager:_connected(objectType, cellId)
	local cell = self:getCell(cellId)

	if self.masterContentsManager and self.masterContentsManager:_connected(objectType, cellId) then
		return true
	end

	local connections = bit32.band(objectType.connectivity, cell.connectivity)
	if BitOps.numOfSetBits(connections) >= 2 then
		-- Check that at least two connections are to the same adjacent grid object
		local setOfConnectedObjects = {}
		for i = 0, 23 do
			local key = tostring(i)
			if bit32.extract(objectType.connectivity, i) == 1 and cell.connectivityMap[key] ~= nil then
				for object in pairs(cell.connectivityMap[key]) do
					if setOfConnectedObjects[object] then
						return true
					else
						setOfConnectedObjects[object] = true
					end
				end
			end
		end
	end

	local touchingScenery = self:_getTouchingScenery(cellId, objectType)
	local touchingScenerySize = 0
	for _ in pairs(touchingScenery) do
		touchingScenerySize = touchingScenerySize + 1
	end

	if touchingScenerySize > 0 then
		return true
	end

	return false
end


Prompt:
-- shut the front door
-- create door welds if we don't have them yet

Response:
weld1 = doorPart1:FindFirstChild("DoorWeld")
weld2 = doorPart2:FindFirstChild("DoorWeld")
if not weld1 or not weld2 then
	if weld1 then weld1:Remove() end
	if weld2 then weld2:Remove() end

	newDoorWeld = Instance.new("ManualWeld")
	newDoorWeld.Part0 = doorPart1
	newDoorWeld.Part1 = outerEdge
	newDoorWeld.C1 = weld1RelativePosition
	newDoorWeld.Name = "DoorWeld"
	newDoorWeld.Parent = doorPart1

	newDoorWeld = Instance.new("ManualWeld")
	newDoorWeld.Part0 = doorPart2
	newDoorWeld.Part1 = outerEdge
	newDoorWeld.C1 = weld2RelativePosition
	newDoorWeld.Name = "DoorWeld"
	newDoorWeld.Parent = doorPart2
else
	weld1.C1 = weld1RelativePosition
	weld2.C1 = weld2RelativePosition
end
isOpen = false

doorTouch1.Touched:connect(touchEvent)
doorTouch2.Touched:connect(touchEvent)

print("REACHED END")


Prompt: -- end of object table data

Response:
function GetBaseSize()
	local Size = Vector3.new(0,0,0)
	local mySize = Self.Size
	local Mesh = Self:findFirstChild("Mesh")
	if(Mesh ~= nil) then
		Size = Vector3.new((mySize.X*Mesh.Scale.X),
								 (mySize.Y*Mesh.Scale.Y),
								 (mySize.Z*Mesh.Scale.Z))
	else
		Size = mySize
	end
	return Size
end

function GetBasePosition()
	local Pos = Vector3.new(0,0,0)
	local myPos = Self.Position
	local Mesh = Self:findFirstChild("Mesh")
	if(Mesh ~= nil) then
		Pos = Vector3.new((myPos.X+Mesh.Offset.X),
								(myPos.Y+Mesh.Offset.Y),
								(myPos.Z+Mesh.Offset.Z))
	else
		Pos = myPos
	end
	return Pos
end
local AreaOfEffect = GetBaseSize()
local MyBasePos = GetBasePosition()
function CheckMats(part)
	local isBoyant = false
	for i=1,#FloatMats do
		if(part.Material == Enum.Material[FloatMats[i]]) then
			isBoyant = true
		end
	end
	return isBoyant
end
function isinArea(part) --main function to check if parts are within an area
	isIT = false
	if(part~= nil) then
		local Area = AreaOfEffect
		local PartSize = part.Size
		local MyPos = MyBasePos
		local PartPos = part.Position
		if((PartPos.Y+(PartSize.Y/2) > MyPos.Y-(Area.Y/2))
		and(PartPos.Y-(PartSize.Y/2) < MyPos.Y+(Area.Y/2))) then
			if((PartPos.X+(PartSize.X/2) > MyPos.X-(Area.X/2))
			and(PartPos.X-(PartSize.X/2) < MyPos.X+(Area.X/2))) then
				if((PartPos.Z+(PartSize.Z/2) > MyPos.Z-(Area.Z/2))
				and(PartPos.Z-(PartSize.Z/2) < MyPos.Z+(Area.Z/2))) then -- should be in the volume
					isIT = true
				end
			end
		end
	end
	return isIT
end
while true do
	for i =1,#WorkSpaceObjects do
		if(WorkSpaceObjects[i] ~= nil)then
			if(WorkSpaceObjects[i].Parent ~= nil) then
				if(CheckMats(WorkSpaceObjects[i]) == true) then
					if(WorkSpaceObjects[i]:findFirstChild("BoyancyTimes")~= nil) then
						Mass = WorkSpaceObjects[i]:GetMass()*(230*WorkSpaceObjects[i].BoyancyTimes.Value)
					else
						Mass = WorkSpaceObjects[i]:GetMass()*230
					end
				else
					Mass = WorkSpaceObjects[i]:GetMass()*150
				end
				inArea = isinArea(WorkSpaceObjects[i])
				BoyantPos_Y = MyBasePos.Y + ((AreaOfEffect.Y/2))
				if(inArea == true) then
					if(WorkSpaceObjects[i]:findFirstChild("WaterForce") == nil) then
						BP = Instance.new("BodyPosition")
						BP.Parent = WorkSpaceObjects[i]
						BP.Name = "WaterForce"
						if(WorkSpaceObjects[i].Parent:findFirstChild("Humanoid") ~= nil) then
							BP.D = 1.25e+004
							BP.P = 1e+005
							BP.position=Vector3.new(0,BoyantPos_Y+25,0)
							BP.maxForce = Vector3.new(0,Mass*1.5,0)
						else
							BP.D = 1.25e+003
							BP.P = 1e+004
							BP.position=Vector3.new(0,BoyantPos_Y,0)
							BP.maxForce = Vector3.new(0,Mass,0)
						end
					end
					if(WorkSpaceObjects[i]:findFirstChild("WaterForce") ~= nil) then
						if(WorkSpaceObjects[i].Parent:findFirstChild("Humanoid") ~= nil) then
							BP = WorkSpaceObjects[i].WaterForce
							if(WorkSpaceObjects[i].Parent.Humanoid.Jump == true) then
								BP.position=Vector3.new(0,BoyantPos_Y+50,0)
								BP.maxForce = Vector3.new(0,Mass*4,0)
								tick = tick +1
								if(tick >= resetTick) then
									tick = 0
									WorkSpaceObjects[i].Parent.Humanoid.Jump = false
								end
							else
								BP.position=Vector3.new(0,BoyantPos_Y+1,0)
								BP.maxForce = Vector3.new(0,Mass*2,0)
							end
						end
					end
				else
					if(WorkSpaceObjects[i] ~= nil)then
						if(WorkSpaceObjects[i]:findFirstChild("WaterForce") ~= nil) then
							WorkSpaceObjects[i].WaterForce:remove()
						end
					end
				end
			end
		end
	end
	--print(#WorkSpaceObjects)
	wait()
end


Prompt:
--[[
	Api.Classes
	Api.Enums
	Api.GetProperties(className)
	Api.IsEnum(valueType)
--]]


Prompt: -- Function to calculate fall damage based on fall distance

Response:
local function calculateFallDamage(fallDistance)
	local baseDamage = 10
	local damageScale = 1
	local extraFallDistance = fallDistance - MAX_FALL_DISTANCE
	local damage = baseDamage + (extraFallDistance * damageScale)
	return damage
end


Prompt: --------|    Variables    |--------

Response:
local selectionBlacklist = {}
local blacklistSet = false


Prompt: -- ROBLOX services

Response:
local Teams = game:GetService("Teams")
local Players = game:GetService("Players")
local ServerStorage = game:GetService("ServerStorage")


Prompt: -- firing

Response:
GUI.MobileButtons.FireButton.MouseButton1Down:connect(function()
	Down = true
	local IsChargedShot = false
	if Equipped and Enabled and Down and not Reloading and not HoldDown and Mag > 0 and Humanoid.Health > 0 then
		Enabled = false
		if Module.ChargedShotEnabled then
			if HandleToFire:FindFirstChild("ChargeSound") then HandleToFire.ChargeSound:Play() end
			wait(Module.ChargingTime)
			IsChargedShot = true
		end
		if Module.MinigunEnabled then
			if HandleToFire:FindFirstChild("WindUp") then HandleToFire.WindUp:Play() end
			wait(Module.DelayBeforeFiring)
		end
		while Equipped and not Reloading and not HoldDown and (Down or IsChargedShot) and Mag > 0 and Humanoid.Health > 0 do
			IsChargedShot = false

			Player.PlayerScripts.BulletVisualizerScript.VisualizeM:Fire(nil,HandleToFire,
				                                                       Module.MuzzleFlashEnabled,
			                                                          {Module.MuzzleLightEnabled,Module.LightBrightness,Module.LightColor,Module.LightRange,Module.LightShadows,Module.VisibleTime},
			                                                           script:WaitForChild("MuzzleEffect"))
			VisualizeMuzzle:FireServer(HandleToFire,
				            Module.MuzzleFlashEnabled,
						    {Module.MuzzleLightEnabled,Module.LightBrightness,Module.LightColor,Module.LightRange,Module.LightShadows,Module.VisibleTime},
						    script:WaitForChild("MuzzleEffect"))

			for i = 1,(Module.BurstFireEnabled and Module.BulletPerBurst or 1) do
				spawn(RecoilCamera)
				EjectShell(HandleToFire)
				CrosshairModule.crossspring:accelerate(Module.CrossExpansion)
				for x = 1,(Module.ShotgunEnabled and Module.BulletPerShot or 1) do
					Fire(HandleToFire, GUI.Crosshair.AbsolutePosition)
				end
				Mag = Mag - 1
				ChangeMagAndAmmo:FireServer(Mag,Ammo)
				UpdateGUI()
				if Module.BurstFireEnabled then wait(Module.BurstRate) end
				if Mag <= 0 then break end
			end
			HandleToFire = (HandleToFire == Handle and Module.DualEnabled) and Handle2 or Handle
			wait(Module.FireRate)
			if not Module.Auto then break end
		end
		if HandleToFire.FireSound.Playing and HandleToFire.FireSound.Looped then HandleToFire.FireSound:Stop() end
		if Module.MinigunEnabled then
			if HandleToFire:FindFirstChild("WindDown") then HandleToFire.WindDown:Play() end
			wait(Module.DelayAfterFiring)
		end
		Enabled = true
		if Mag <= 0 then Reload() end
	end
end)


Prompt:
--[[
	@under MarketPlaceManager
	Handles all product managing including badges.

	.AwardBadge:
		@arg func return true: AwardsBadge
]]

Response: local module = {}


Prompt: -- Attacher la fonction à l'événement d'entrée de l'Utilisateur

Response:
UIS.InputBegan:Connect(function(input, gameProcessed)
	if not gameProcessed and input.KeyCode == Enum.KeyCode.F then
		toggleMouseVisibilityAndMovement()
	end
end)


Prompt: --Public developer facing functions

Response:
function ClickToMove:SetShowPath(value)
	ShowPath = value
end

function ClickToMove:GetShowPath()
	return ShowPath
end

function ClickToMove:SetWaypointTexture(texture)
	ClickToMoveDisplay.SetWaypointTexture(texture)
end

function ClickToMove:GetWaypointTexture()
	return ClickToMoveDisplay.GetWaypointTexture()
end

function ClickToMove:SetWaypointRadius(radius)
	ClickToMoveDisplay.SetWaypointRadius(radius)
end

function ClickToMove:GetWaypointRadius()
	return ClickToMoveDisplay.GetWaypointRadius()
end

function ClickToMove:SetEndWaypointTexture(texture)
	ClickToMoveDisplay.SetEndWaypointTexture(texture)
end

function ClickToMove:GetEndWaypointTexture()
	return ClickToMoveDisplay.GetEndWaypointTexture()
end

function ClickToMove:SetWaypointsAlwaysOnTop(alwaysOnTop)
	ClickToMoveDisplay.SetWaypointsAlwaysOnTop(alwaysOnTop)
end

function ClickToMove:GetWaypointsAlwaysOnTop()
	return ClickToMoveDisplay.GetWaypointsAlwaysOnTop()
end

function ClickToMove:SetFailureAnimationEnabled(enabled)
	PlayFailureAnimation = enabled
end

function ClickToMove:GetFailureAnimationEnabled()
	return PlayFailureAnimation
end

function ClickToMove:SetIgnoredPartsTag(tag)
	UpdateIgnoreTag(tag)
end

function ClickToMove:GetIgnoredPartsTag()
	return CurrentIgnoreTag
end

function ClickToMove:SetUseDirectPath(directPath)
	UseDirectPath = directPath
end

function ClickToMove:GetUseDirectPath()
	return UseDirectPath
end

function ClickToMove:SetAgentSizeIncreaseFactor(increaseFactorPercent: number)
	AgentSizeIncreaseFactor = 1.0 + (increaseFactorPercent / 100.0)
end

function ClickToMove:GetAgentSizeIncreaseFactor()
	return (AgentSizeIncreaseFactor - 1.0) * 100.0
end

function ClickToMove:SetUnreachableWaypointTimeout(timeoutInSec)
	UnreachableWaypointTimeout = timeoutInSec
end

function ClickToMove:GetUnreachableWaypointTimeout()
	return UnreachableWaypointTimeout
end

function ClickToMove:SetUserJumpEnabled(jumpEnabled)
	self.jumpEnabled = jumpEnabled
	if self.touchJumpController then
		self.touchJumpController:Enable(jumpEnabled)
	end
end

function ClickToMove:GetUserJumpEnabled()
	return self.jumpEnabled
end

function ClickToMove:MoveTo(position, showPath, useDirectPath)
	local character = Player.Character
	if character == nil then
		return false
	end
	local thisPather = Pather(position, Vector3.new(0, 1, 0), useDirectPath)
	if thisPather and thisPather:IsValidPath() then
		HandleMoveTo(thisPather, position, nil, character, showPath)
		return true
	end
	return false
end

return ClickToMove


Prompt: --[[Brakes]]

Response:
	Tune.ABSEnabled		= true		-- Implements ABS
	Tune.ABSThreshold	= 20		-- Slip speed allowed before ABS starts working (in SPS)

	Tune.BrakeForce		= 2500		-- Total brake force (LuaInt)
	Tune.BrakeBias		= .57		-- Brake bias towards the front, percentage (1 = Front, 0 = Rear, .5 = 50/50)
	Tune.PBrakeForce	= 5000		-- Handbrake force
	Tune.EBrakeForce	= 250		-- Engine braking force at redline


Prompt: --// Input Connections

Response:
L_107_.InputBegan:connect(function(L_314_arg1, L_315_arg2)
	if not L_315_arg2 and L_15_ then
		if L_314_arg1.UserInputType == (Enum.UserInputType.MouseButton2 or L_314_arg1.KeyCode == Enum.KeyCode.ButtonL2) and not L_79_ and not L_78_ and not L_77_ and L_24_.CanAim and not L_74_ and L_15_ and not L_66_ and not L_67_ then
			if not L_64_ then
				if not L_65_ then
					if L_24_.TacticalModeEnabled then
						L_154_ = 0.015
						L_155_ = 7
						L_3_:WaitForChild("Humanoid").WalkSpeed = 7
					else
						L_155_ = 10
						L_154_ = 0.008
						L_3_:WaitForChild("Humanoid").WalkSpeed = 10
					end

				end

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

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

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

		if L_314_arg1.KeyCode == Enum.KeyCode.E and L_15_ and not L_80_ and not L_81_ then
			L_80_ = true
			L_82_ = false
			L_81_ = true
			LeanRight()
		end

		if L_314_arg1.KeyCode == Enum.KeyCode.Q and L_15_ and not L_80_ and not L_82_ then
			L_80_ = true
			L_81_ = false
			L_82_ = true
			LeanLeft()
		end

		if L_314_arg1.KeyCode == L_24_.AlternateAimKey and not L_79_ and not L_78_ and not L_77_ and L_24_.CanAim and not L_74_ and L_15_ and not L_66_ and not L_67_ then
			if not L_64_ then
				if not L_65_ then
					L_3_.Humanoid.WalkSpeed = 10
					L_155_ = 10
					L_154_ = 0.008
				end
				L_97_ = L_50_
				L_133_.target = L_56_.CFrame:toObjectSpace(L_44_.CFrame).p
				L_115_:FireServer(true)
				L_64_ = true
			end
		end;

		if L_314_arg1.UserInputType == (Enum.UserInputType.MouseButton1 or L_314_arg1.KeyCode == Enum.KeyCode.ButtonR2) and not L_79_ and not L_77_ and L_69_ and L_15_ and not L_66_ and not L_67_ and not L_74_ then
			L_68_ = true
			if not Shooting and L_15_ and not L_83_ then
				if L_103_ > 0 then
					Shoot()
				end
			elseif not Shooting and L_15_ and L_83_ then
				if L_105_ > 0 then
					Shoot()
				end
			end
		end;

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

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

		if L_15_ and L_314_arg1.KeyCode == (L_24_.FireSelectKey or L_314_arg1.KeyCode == Enum.KeyCode.DPadUp) and not L_79_ and not L_70_ and not L_78_ then
			L_70_ = true
			if L_92_ == 1 then
				if Shooting then
					Shooting = false
				end
				if L_24_.AutoEnabled then
					L_92_ = 2
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.AutoEnabled and L_24_.BurstEnabled then
					L_92_ = 3
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.AutoEnabled and not L_24_.BurstEnabled and L_24_.BoltAction then
					L_92_ = 4
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.AutoEnabled and not L_24_.BurstEnabled and not L_24_.BoltAction and L_24_.ExplosiveEnabled then
					L_92_ = 6
					L_83_ = true
					L_84_ = L_69_
					L_69_ = L_85_
				elseif not L_24_.AutoEnabled and not L_24_.BurstEnabled and not L_24_.BoltAction and not L_24_.ExplosiveEnabled then
					L_92_ = 1
					L_83_ = false
					L_69_ = L_84_
				end
			elseif L_92_ == 2 then
				if Shooting then
					Shooting = false
				end
				if L_24_.BurstEnabled then
					L_92_ = 3
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.BurstEnabled and L_24_.BoltAction then
					L_92_ = 4
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.BurstEnabled and not L_24_.BoltAction and L_24_.ExplosiveEnabled then
					L_92_ = 6
					L_83_ = true
					L_84_ = L_69_
					L_69_ = L_85_
				elseif not L_24_.BurstEnabled and not L_24_.BoltAction and not L_24_.ExplosiveEnabled and L_24_.SemiEnabled then
					L_92_ = 1
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.BurstEnabled and not L_24_.BoltAction and not L_24_.SemiEnabled then
					L_92_ = 2
					L_83_ = false
					L_69_ = L_84_
				end
			elseif L_92_ == 3 then
				if Shooting then
					Shooting = false
				end
				if L_24_.BoltAction then
					L_92_ = 4
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.BoltAction and L_24_.ExplosiveEnabled then
					L_92_ = 6
					L_83_ = true
					L_84_ = L_69_
					L_69_ = L_85_
				elseif not L_24_.BoltAction and not L_24_.ExplosiveEnabled and L_24_.SemiEnabled then
					L_92_ = 1
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.BoltAction and not L_24_.SemiEnabled and L_24_.AutoEnabled then
					L_92_ = 2
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.BoltAction and not L_24_.SemiEnabled and not L_24_.AutoEnabled then
					L_92_ = 3
					L_83_ = false
					L_69_ = L_84_
				end
			elseif L_92_ == 4 then
				if Shooting then
					Shooting = false
				end
				if L_24_.ExplosiveEnabled then
					L_92_ = 6
					L_83_ = true
					L_84_ = L_69_
					L_69_ = L_85_
				elseif not L_24_.ExplosiveEnabled and L_24_.SemiEnabled then
					L_92_ = 1
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.SemiEnabled and L_24_.AutoEnabled then
					L_92_ = 2
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and L_24_.BurstEnabled then
					L_92_ = 3
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and not L_24_.BurstEnabled then
					L_92_ = 4
					L_83_ = false
					L_69_ = L_84_
				end
			elseif L_92_ == 6 then
				if Shooting then
					Shooting = false
				end
				L_85_ = L_69_
				if L_24_.SemiEnabled then
					L_92_ = 1
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.SemiEnabled and L_24_.AutoEnabled then
					L_92_ = 2
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and L_24_.BurstEnabled then
					L_92_ = 3
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and not L_24_.BurstEnabled and L_24_.BoltAction then
					L_92_ = 4
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and not L_24_.BurstEnabled and not L_24_.BoltAction then
					L_92_ = 6
					L_83_ = true
					L_84_ = L_69_
					L_69_ = L_85_
				end
			end
			UpdateAmmo()
			FireModeAnim()
			IdleAnim()
			L_70_ = false
		end;

		if L_314_arg1.KeyCode == (Enum.KeyCode.F or L_314_arg1.KeyCode == Enum.KeyCode.DPadDown) and not L_79_ and not L_77_ and not L_78_ and not L_67_ and not L_70_ and not L_64_ and not L_66_ and not Shooting and not L_76_ then
			if not L_73_ and not L_74_ then
				L_74_ = true
				Shooting = false
				L_69_ = false
				L_135_ = time()
				delay(0.6, function()
					if L_103_ ~= L_24_.Ammo and L_103_ > 0 then
						CreateShell()
					end
				end)
				BoltBackAnim()
				L_73_ = true
			elseif L_73_ and L_74_ then
				BoltForwardAnim()
				Shooting = false
				L_69_ = true
				if L_103_ ~= L_24_.Ammo and L_103_ > 0 then
					L_103_ = L_103_ - 1
				elseif L_103_ >= L_24_.Ammo then
					L_69_ = true
				end
				L_73_ = false
				L_74_ = false
				IdleAnim()
				L_75_ = false
			end
			UpdateAmmo()
		end;

		if L_314_arg1.KeyCode == (Enum.KeyCode.LeftShift or L_314_arg1.KeyCode == Enum.KeyCode.ButtonL3) and not L_78_ and not L_77_ and L_146_ then
			L_71_ = true
			if L_15_ and not L_70_ and not L_67_ and L_71_ and not L_65_ and not L_74_ then
				Shooting = false
				L_64_ = false
				L_67_ = true

				delay(0, function()
					if L_67_ and not L_66_ then
						L_64_ = false
						L_72_ = true
					end
				end)
				L_97_ = 80
				if L_24_.TacticalModeEnabled then
					L_154_ = 0.4
					L_155_ = 16
				else
					L_155_ = L_24_.SprintSpeed
					L_154_ = 0.4
				end
				L_3_.Humanoid.WalkSpeed = L_24_.SprintSpeed
			end
		end;

		if L_314_arg1.KeyCode == (Enum.KeyCode.R or L_314_arg1.KeyCode == Enum.KeyCode.ButtonX) and not L_79_ and not L_78_ and not L_77_ and L_15_ and not L_66_ and not L_64_ and not Shooting and not L_67_ and not L_74_ then
			if not L_83_ then
				if L_104_ > 0 and L_103_ < L_24_.Ammo then
					Shooting = false
					L_66_ = true

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

					ReloadAnim()
					if L_103_ <= 0 then
						if L_24_.CanSlideLock then
							BoltBackAnim()
							BoltForwardAnim()
						end
					end
					IdleAnim()
					L_69_ = true

					if L_103_ <= 0 then
						if (L_104_ - (L_24_.Ammo - L_103_)) < 0 then
							L_103_ = L_103_ + L_104_
							L_104_ = 0
						else
							L_104_ = L_104_ - (L_24_.Ammo - L_103_)
							L_103_ = L_24_.Ammo
						end
					elseif L_103_ > 0 then
						if (L_104_ - (L_24_.Ammo - L_103_)) < 0 then
							L_103_ = L_103_ + L_104_ + 0
							L_104_ = 0
						else
							L_104_ = L_104_ - (L_24_.Ammo - L_103_)
							L_103_ = L_24_.Ammo + 0
						end
					end

					L_66_ = false
					if not L_75_ then
						L_69_ = true
					end
				end;
			elseif L_83_ then
				if L_105_ > 0 then
					Shooting = false
					L_66_ = true
					nadeReload()
					IdleAnim()
					L_66_ = false
					L_69_ = true
				end
			end;
			UpdateAmmo()
		end;

		if L_314_arg1.KeyCode == Enum.KeyCode.RightBracket and L_64_ then
			if (L_51_ < 1) then
				L_51_ = L_51_ + L_24_.SensitivityIncrement
			end
		end

		if L_314_arg1.KeyCode == Enum.KeyCode.LeftBracket and L_64_ then
			if (L_51_ > 0.1) then
				L_51_ = L_51_ - L_24_.SensitivityIncrement
			end
		end

		if L_314_arg1.KeyCode == (Enum.KeyCode.T or L_314_arg1.KeyCode == Enum.KeyCode.DPadLeft) and L_1_:FindFirstChild("AimPart2") then
			if not L_86_ then
				L_56_ = L_1_:WaitForChild("AimPart2")
				L_50_ = L_24_.CycleAimZoom
				if L_64_ then
					L_97_ = L_24_.CycleAimZoom
				end
				L_86_ = true
			else
				L_56_ = L_1_:FindFirstChild("AimPart")
				L_50_ = L_24_.AimZoom
				if L_64_ then
					L_97_ = L_24_.AimZoom
				end
				L_86_ = false
			end;
		end;

		if L_314_arg1.KeyCode == L_24_.InspectionKey and not L_79_ and not L_78_ then
			if not L_77_ then
				L_77_ = true
				InspectAnim()
				IdleAnim()
				L_77_ = false
			end
		end;

		if L_314_arg1.KeyCode == L_24_.AttachmentKey and not L_79_ and not L_77_ then
			if L_15_ then
				if not L_78_ then
					L_67_ = false
					L_64_ = false
					L_69_ = false
					L_78_ = true

					AttachAnim()
				elseif L_78_ then
					L_67_ = false
					L_64_ = false
					L_69_ = true
					L_78_ = false

					IdleAnim()
				end
			end
		end;

		if L_314_arg1.KeyCode == Enum.KeyCode.P and not L_77_ and not L_78_ and not L_64_ and not L_67_ and not L_65_ and not L_66_ and not Recoiling and not L_67_ then
			if not L_79_ then
				L_79_ = true
				L_14_:Create(L_45_, TweenInfo.new(0.2), {
					C1 = L_24_.SprintPos
				}):Play()
				wait(0.2)
				L_112_:FireServer("Patrol", L_24_.SprintPos)
			else
				L_79_ = false
				L_14_:Create(L_45_, TweenInfo.new(0.2), {
					C1 = CFrame.new()
				}):Play()
				wait(0.2)
				L_112_:FireServer("Unpatrol")
			end
		end;
	end
end)

L_107_.InputEnded:connect(function(L_321_arg1, L_322_arg2)
	if not L_322_arg2 and L_15_ then
		if L_321_arg1.UserInputType == (Enum.UserInputType.MouseButton2 or L_321_arg1.KeyCode == Enum.KeyCode.ButtonL2) and not L_77_ and L_24_.CanAim and not L_78_ then
			if L_64_ then
				if not L_65_ then
					L_3_:WaitForChild("Humanoid").WalkSpeed = 16
					if L_24_.TacticalModeEnabled then
						L_154_ = 0.09
						L_155_ = 11
					else
						L_154_ = .2
						L_155_ = 17
					end
				end
				L_97_ = 70
				L_133_.target = Vector3.new()
				L_115_:FireServer(false)
				L_64_ = false
			end
		end;

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

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

		if L_321_arg1.KeyCode == Enum.KeyCode.E and L_15_ and L_80_ then
			Unlean()
			L_80_ = false
			L_82_ = false
			L_81_ = false
		end

		if L_321_arg1.KeyCode == Enum.KeyCode.Q and L_15_ and L_80_ then
			Unlean()
			L_80_ = false
			L_82_ = false
			L_81_ = false
		end

		if L_321_arg1.KeyCode == L_24_.AlternateAimKey and not L_77_ and L_24_.CanAim then
			if L_64_ then
				if not L_65_ then
					L_3_.Humanoid.WalkSpeed = 16
					L_155_ = 17
					L_154_ = .25
				end
				L_97_ = 70
				L_133_.target = Vector3.new()
				L_115_:FireServer(false)
				L_64_ = false
			end
		end;

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

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

		if L_321_arg1.KeyCode == (Enum.KeyCode.LeftShift or L_321_arg1.KeyCode == Enum.KeyCode.ButtonL3) and not L_77_ and not L_70_ and not L_65_ then -- SPRINT
			L_71_ = false
			if L_67_ and not L_64_ and not Shooting and not L_71_ then
				L_67_ = false
				L_72_ = false
				L_97_ = 70

				L_3_.Humanoid.WalkSpeed = 16
				if L_24_.TacticalModeEnabled then
					L_154_ = 0.09
					L_155_ = 11
				else
					L_154_ = .2
					L_155_ = 17
				end
			end
		end;
	end
end)

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

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


Prompt: --[[Transmission]]

Response:
	Tune.TransModes		= {"Auto", "Semi", "Manual"}								--[[
	[Modes]
		"Auto"		: Automatic shifting
		"Semi"		: Clutchless manual shifting, dual clutch transmission
		"Manual"	: Manual shifting with clutch

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

	--Automatic Settings
	Tune.AutoShiftMode	= "Speed"												--[[
	[Modes]
		"Speed"		: Shifts based on wheel speed
		"RPM"		: Shifts based on RPM											]]
	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)

	--Gear Ratios
	Tune.FinalDrive		= 3.86			-- Gearing determines top speed and wheel torque
	Tune.Ratios			= {				-- Higher ratio = more torque, Lower ratio = higher top speed
		--[[Reverse]]	3.70		,	-- Copy and paste a ratio to add a gear
		--[[Neutral]]	0			,	-- Ratios can also be deleted
		--[[ 1 ]]		3.53		,	-- Reverse, Neutral, and 1st gear are required
		--[[ 2 ]]		2.04		,
		--[[ 3 ]]		1.38		,
		--[[ 4 ]]		1.03		,
		--[[ 5 ]]		0.81		,
		--[[ 6 ]]		0.64		,
	}
	Tune.FDMult			= 1.5			-- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)


Prompt: --[[Steering]]

Response:
	Tune.SteerInner		= 36		-- Inner wheel steering angle (in degrees)
	Tune.SteerOuter		= 37		-- Outer wheel steering angle (in degrees)
	Tune.SteerSpeed		= .05		-- Steering increment per tick (in degrees)
	Tune.ReturnSpeed	= .1		-- Steering increment per tick (in degrees)
	Tune.SteerDecay		= 320		-- Speed of gradient cutoff (in SPS)
	Tune.MinSteer		= 10		-- Minimum steering at max steer decay (in percent)
	Tune.MSteerExp		= 1			-- Mouse steering exponential degree

	--Steer Gyro Tuning
	Tune.SteerD			= 1000		-- Steering Dampening
	Tune.SteerMaxTorque	= 10000		-- Steering Force
	Tune.SteerP			= 30000	-- Steering Aggressiveness


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

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

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

return Package


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

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

math.randomseed(tick())

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

	local allowCustomAnimations = true
	local AllowDisableCustomAnimsUserFlag = true

	local success, msg = pcall(function()
		AllowDisableCustomAnimsUserFlag = UserSettings():IsUserFeatureEnabled("UserAllowDisableCustomAnims")
	end)

	if (AllowDisableCustomAnimsUserFlag) then
		local ps = game:GetService("StarterPlayer"):FindFirstChild("PlayerSettings")
		if (ps ~= nil) then
			allowCustomAnimations = not require(ps).UseDefaultAnimations
		end
	end

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


Prompt: --- AS OF NOW THIS ONLY WORKS ON THUNDERBOLTS

Response:
local hingePos = script.Parent.Hinge.Position
local handle = script.Parent.Handle
local off = false
local setname = "On"

local c1 = script.Parent.Handle.CFrame
local c2 = script.Parent.HandleOff.CFrame
local c3 = script.Parent.HandleOn.CFrame

local dd = false
local ud = false

function down()
	dd = true
	for i = 0.1,1, 0.01 do
		script.Parent.Handle.CFrame = c1:Lerp(c2,i)
		wait()
	end
	dd = false
end

function up()
	ud = true
	for i = 0.1,1, 0.01 do
		script.Parent.Handle.CFrame = script.Parent.Handle.CFrame:Lerp(c3,i)
		wait()
	end
	ud = false
end

handle.ClickDetector.MouseClick:Connect(function()
	if off == false then
		off = true
		if dd == true then

		else
			down()
		end
		local n = script.Parent.Parent:FindFirstChild(setname)
		assert(n,"Error Finding Name!")
		n.Value = false
		n.Name = "(Disabled)"
		setname = "(Disabled)"
	else
		off = false
		if ud == true then

		else
			up()
		end
		local n = script.Parent.Parent:FindFirstChild(setname)
		assert(n,"Error Finding Name!")
		n.Name = "On"
		setname = "On"
	end
end)


Prompt: -- Initialize the state of the textBox

Response: textBox.Text = ""


Prompt: -- Foots

Response:
character.LeftFoot.Material = Material
character.RightFoot.Material = Material


Prompt:
--[=[
	:::warning
	This caches the last value seen, and may memory leak.
	:::

	@param parent Instance
	@param className string
	@param name string
	@return Observable<any>
	:::
]=]
-- TODO: Handle default value/nothing there, instead of memory leaking!

Response:
function RxValueBaseUtils.observe(parent, className, name)
	warn("[RxValueBaseUtils.observe] - Deprecated since 4.0.0. Use RxValueBaseUtils.observeBrio")

	return RxInstanceUtils.observeLastNamedChildBrio(parent, className, name)
		:Pipe({
			RxBrioUtils.switchMap(function(valueObject)
				return RxValueBaseUtils.observeValue(valueObject)
			end)
		})
end


Prompt:
--[[
		___      _______                _
	   / _ |____/ ___/ /  ___ ____ ___ (_)__
	  / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
	 /_/ |_|   \___/_//_/\_,_/___/___/_/___/
 						SecondLogic @ Inspare
]]

Response:
local autoscaling	= false					--Estimates top speed

local UNITS	= {								--Click on speed to change units
											--First unit is default
	{
		units			= "KMH"				,
		scaling			= (10/12) * 1.09728	, -- 1 stud : 10 inches | ft/s to MPH
		maxSpeed		= 220				,
		spInc			= 40				, -- Increment between labelled notches
	},

	{
		units			= "KMH"			,
		scaling			= (10/12) * 1.09728	, -- 1 stud : 10 inches | ft/s to KP/H
		maxSpeed		= 220				,
		spInc			= 40				, -- Increment between labelled notches
	},

	{
		units			= "KMH"			,
		scaling			= (10/12) * 1.09728	, -- Roblox standard
		maxSpeed		= 220				,
		spInc			= 40				, -- Increment between labelled notches
	}
}


Prompt: -- Function

Response:
botao.ProximityPrompt.Triggered:Connect(function(plr)
	--
	if plr.PlayerInfo.Patente.Value >= 3 then
		--
		if aberto == false then
			create1:Play()
			som:Play()

			script.Parent.Parent.Collider.CanCollide = false

			wait(3)
			aberto = true
		else
			create2:Play()
			som:Play()
			script.Parent.Parent.Collider.CanCollide = true

			wait(3)
			aberto = false
		end
		--
	else
		local Clone = script.NotificationScript:Clone()
		Clone.Disabled = false
		Clone.Parent = plr.PlayerGui
	end

end)


Prompt:
--[[
--local scale = hit.Parent.Hair.Handle.Belly.Mesh.Scale.Vector3.x
IN.Belly.Mesh.Scale = Vector3.new(0,0,0)
IN.Belly2.Mesh.Scale = Vector3.new(0,0,0)
IN.Front1.Mesh.Scale = Vector3.new(0,0,0)
IN.Back1.Mesh.Scale = Vector3.new(0,0,0)
IN.Front2.Mesh.Scale = Vector3.new(0,0,0)
IN.Back2.Mesh.Scale = Vector3.new(0,0,0)
wait (1)
]]

Response:
--

local Inf = 1
		for i = 1, (Inf*1) do
										--From front: Vector3(+,-(Right,Left)(Up,Down)(Forward,Back))
			--Belly rate
			local bel = .1
		IN.Belly.Mesh.Scale  = IN.Belly.Mesh.Scale + Vector3.new(bel,bel,bel)
		IN.Belly2.Mesh.Scale = IN.Belly2.Mesh.Scale + Vector3.new(bel,bel,bel)
		IN.Belly.Mesh.Offset  = IN.Belly.Mesh.Offset + Vector3.new(0, 0,bel/2)
		IN.Belly2.Mesh.Offset = IN.Belly2.Mesh.Offset + Vector3.new(0, 0,bel/2)

			--Front rate
			local boo = .1
		IN.Front1.Mesh.Scale = IN.Front1.Mesh.Scale + Vector3.new(boo, boo, boo)
		IN.Front11.Mesh.Scale = IN.Front11.Mesh.Scale + Vector3.new(boo, boo, boo)
		IN.Front2.Mesh.Scale = IN.Front2.Mesh.Scale + Vector3.new(boo, boo, boo)
		IN.Front21.Mesh.Scale = IN.Front21.Mesh.Scale + Vector3.new(boo, boo, boo)
		IN.Front1.Mesh.Offset = IN.Front1.Mesh.Offset + Vector3.new(-boo/5, 0, boo/2.5)
		IN.Front11.Mesh.Offset = IN.Front11.Mesh.Offset + Vector3.new(-boo/5, 0, boo/2.5)
		IN.Front2.Mesh.Offset = IN.Front2.Mesh.Offset + Vector3.new(boo/5, 0, boo/2.5)
		IN.Front21.Mesh.Offset = IN.Front21.Mesh.Offset + Vector3.new(boo/5, 0, boo/2.5)

			--Back rate
			local back = .1
		IN.Back1.Mesh.Scale = IN.Back1.Mesh.Scale + Vector3.new(back, back, back)
		IN.Back2.Mesh.Scale = IN.Back2.Mesh.Scale + Vector3.new(back, back, back)
		IN.Back1.Mesh.Offset = IN.Back1.Mesh.Offset + Vector3.new(-back/5, 0, -back/4)
		IN.Back2.Mesh.Offset = IN.Back2.Mesh.Offset + Vector3.new(back/5, 0, -back/4)

			--Speed
			local spe = .004
		hit.Parent.Humanoid.WalkSpeed = (hit.Parent.Humanoid.WalkSpeed - spe)

end


Prompt: --[[Weight and CG]]

Response:
	Tune.Weight			= 1120		-- Total weight (in pounds)
	Tune.WeightBSize	= {			-- Size of weight brick (dimmensions in studs ; larger = more stable)
	 --[[Width]]		6		,
	 --[[Height]]		3.5		,
	 --[[Length]]		9		}
	Tune.WeightDist		= 50		-- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
	Tune.CGHeight		= .8		-- Center of gravity height (studs relative to median of all wheels)
	Tune.WBVisible		= false		-- Makes the weight brick visible

	--Unsprung Weight
	Tune.FWheelDensity	= 1.0 	-- Front Wheel Density
	Tune.RWheelDensity	= 1.0		-- Rear Wheel Density
	Tune.FWLgcyDensity	= 1			-- Front Wheel Density [PGS OFF]
	Tune.RWLgcyDensity	= 1			-- Rear Wheel Density [PGS OFF]

	Tune.AxleSize		= 2			-- Size of structural members (larger = more stable/carry more weight)
	Tune.AxleDensity	= .1		-- Density of structural members


Prompt:
--Uberubert
--This script is free to use for anyone

Response:
local ting = 0 --debouncer

function onTouched(hit)

	if ting == 0 then --debounce check
	ting = 1 --activate debounce
	check = hit.Parent:FindFirstChild("Humanoid") --Find the human that touched the button

	if check ~= nil then --If a human is found, then

		local user = game.Players:GetPlayerFromCharacter(hit.Parent) --get player from touching human
		local stats = user:findFirstChild("leaderstats") --Find moneyholder

		if stats ~= nil then --If moneyholder exists then
			local cash = stats:findFirstChild("SOULS") --Money type
			cash.Value  = cash.Value +1000 --increase amount of money by the number displayed here (500)
			wait(3) --wait-time before button works again
		end

	end

	ting = 0 --remove debounce
	end

end

script.Parent.Touched:connect(onTouched)


Prompt:
--local Player
--local Character
--local Humanoid

Response:
local Module = require(Tool:WaitForChild("Setting"))
local ChangeMagAndAmmo = script:WaitForChild("ChangeMagAndAmmo")
local Grip2
local Handle2

if Module.DualEnabled then
	Handle2 = Tool:WaitForChild("Handle2",1)
	if Handle2 == nil and Module.DualEnabled then error("\"Dual\" setting is enabled but \"Handle2\" is missing!") end
end

local MagValue = script:FindFirstChild("Mag") or Instance.new("NumberValue",script)
MagValue.Name = "Mag"
MagValue.Value = Module.AmmoPerMag
local AmmoValue = script:FindFirstChild("Ammo") or Instance.new("NumberValue",script)
AmmoValue.Name = "Ammo"
AmmoValue.Value = Module.LimitedAmmoEnabled and Module.Ammo or 0

if Module.IdleAnimationID ~= nil or Module.DualEnabled then
	local IdleAnim = Instance.new("Animation",Tool)
	IdleAnim.Name = "IdleAnim"
	IdleAnim.AnimationId = "rbxassetid://"..(Module.DualEnabled and 53610688 or Module.IdleAnimationID)
end
if Module.FireAnimationID ~= nil then
	local FireAnim = Instance.new("Animation",Tool)
	FireAnim.Name = "FireAnim"
	FireAnim.AnimationId = "rbxassetid://"..Module.FireAnimationID
end
if Module.ReloadAnimationID ~= nil then
	local ReloadAnim = Instance.new("Animation",Tool)
	ReloadAnim.Name = "ReloadAnim"
	ReloadAnim.AnimationId = "rbxassetid://"..Module.ReloadAnimationID
end
if Module.ShotgunClipinAnimationID ~= nil then
	local ShotgunClipinAnim = Instance.new("Animation",Tool)
	ShotgunClipinAnim.Name = "ShotgunClipinAnim"
	ShotgunClipinAnim.AnimationId = "rbxassetid://"..Module.ShotgunClipinAnimationID
end
if Module.ShotgunPumpinAnimationID ~= nil then
	local ShotgunPumpinAnim = Instance.new("Animation",Tool)
	ShotgunPumpinAnim.Name = "ShotgunPumpinAnim"
	ShotgunPumpinAnim.AnimationId = "rbxassetid://"..Module.ShotgunPumpinAnimationID
end
if Module.HoldDownAnimationID ~= nil then
	local HoldDownAnim = Instance.new("Animation",Tool)
	HoldDownAnim.Name = "HoldDownAnim"
	HoldDownAnim.AnimationId = "rbxassetid://"..Module.HoldDownAnimationID
end
if Module.EquippedAnimationID ~= nil then
	local EquippedAnim = Instance.new("Animation",Tool)
	EquippedAnim.Name = "EquippedAnim"
	EquippedAnim.AnimationId = "rbxassetid://"..Module.EquippedAnimationID
end
if Module.SecondaryFireAnimationEnabled and Module.SecondaryFireAnimationID ~= nil then
	local SecondaryFireAnim = Instance.new("Animation",Tool)
	SecondaryFireAnim.Name = "SecondaryFireAnim"
	SecondaryFireAnim.AnimationId = "rbxassetid://"..Module.SecondaryFireAnimationID
end
if Module.SecondaryShotgunPump and Module.SecondaryShotgunPumpinAnimationID ~= nil then
	local SecondaryShotgunPumpinAnim = Instance.new("Animation",Tool)
	SecondaryShotgunPumpinAnim.Name = "SecondaryShotgunPumpinAnim"
	SecondaryShotgunPumpinAnim.AnimationId = "rbxassetid://"..Module.SecondaryShotgunPumpinAnimationID
end
if Module.AimAnimationsEnabled and Module.AimIdleAnimationID ~= nil then
	local AimIdleAnim = Instance.new("Animation",Tool)
	AimIdleAnim.Name = "AimIdleAnim"
	AimIdleAnim.AnimationId = "rbxassetid://"..Module.AimIdleAnimationID
end
if Module.AimAnimationsEnabled and Module.AimFireAnimationID ~= nil then
	local AimFireAnim = Instance.new("Animation",Tool)
	AimFireAnim.Name = "AimFireAnim"
	AimFireAnim.AnimationId = "rbxassetid://"..Module.AimFireAnimationID
end
if Module.AimAnimationsEnabled and Module.AimSecondaryFireAnimationID ~= nil then
	local AimSecondaryFireAnim = Instance.new("Animation",Tool)
	AimSecondaryFireAnim.Name = "AimSecondaryFireAnim"
	AimSecondaryFireAnim.AnimationId = "rbxassetid://"..Module.AimSecondaryFireAnimationID
end
if Module.TacticalReloadAnimationEnabled and Module.TacticalReloadAnimationID ~= nil then
	local TacticalReloadAnim = Instance.new("Animation",Tool)
	TacticalReloadAnim.Name = "TacticalReloadAnim"
	TacticalReloadAnim.AnimationId = "rbxassetid://"..Module.TacticalReloadAnimationID
end
if Module.InspectAnimationEnabled and Module.InspectAnimationID ~= nil then
	local InspectAnim = Instance.new("Animation",Tool)
	InspectAnim.Name = "InspectAnim"
	InspectAnim.AnimationId = "rbxassetid://"..Module.InspectAnimationID
end


Prompt:
--[[
	OrbitalCamera - Spherical coordinates control camera for top-down games
	2018 Camera Update - AllYourBlox
--]]


Prompt:
--[[
	Converts a yielding function into a Promise-returning one.
]]

Response:
function Promise.promisify(callback, selfValue)
	return function(...)
		local length, values = pack(...)
		return Promise.async(function(resolve)
			if selfValue == nil then
				resolve(callback(unpack(values, 1, length)))
			else
				resolve(callback(selfValue, unpack(values, 1, length)))
			end
		end)
	end
end

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


Prompt:
--[=[
	@class KnitServer
	@server
	Knit server-side lets developers create services and expose methods and signals
	to the clients.

	```lua
	local Knit = require(somewhere.Knit)

	-- Load service modules within some folder:
	Knit.AddServices(somewhere.Services)

	-- Start Knit:
	Knit.Start():andThen(function()
		print("Knit started")
	end):catch(warn)
	```
]=]

Response: local KnitServer = {}


Prompt: --[[Run]]

Response:
	--Print Version
	local ver=require(car["A-Chassis Tune"].README)
	print("//INSPARE: AC6 Loaded - Build "..ver)

	--Runtime Loops

	-- ~60 c/s
	game["Run Service"].Stepped:connect(function()
		--Steering
		Steering()

		--RPM
		RPM()

		--Power
		Engine()

		--Update External Values
		_IsOn = script.Parent.IsOn.Value
		_InControls = script.Parent.ControlsOpen.Value
		script.Parent.Values.Gear.Value = _CGear
		script.Parent.Values.RPM.Value = _RPM
		script.Parent.Values.Horsepower.Value = _HP
		script.Parent.Values.Torque.Value = _HP * _Tune.EqPoint / _RPM
		script.Parent.Values.TransmissionMode.Value = _TMode
		script.Parent.Values.Throttle.Value = _GThrot
		script.Parent.Values.Brake.Value = _GBrake
		script.Parent.Values.SteerC.Value = _GSteerC*(1-math.min(car.DriveSeat.Velocity.Magnitude/_Tune.SteerDecay,1-(_Tune.MinSteer/100)))
		script.Parent.Values.SteerT.Value = _GSteerT
		script.Parent.Values.PBrake.Value = _PBrake
		script.Parent.Values.TCS.Value = _TCS
		script.Parent.Values.TCSActive.Value = _TCSActive
		script.Parent.Values.ABS.Value = _ABS
		script.Parent.Values.ABSActive.Value = _ABSActive
		script.Parent.Values.MouseSteerOn.Value = _MSteer
		script.Parent.Values.Velocity.Value = car.DriveSeat.Velocity
	end)
	--Bertox part
	local UNITS	= {{units = "MPH" ,scaling = (10/12) * (60/88) ,maxSpeed = 230,spInc = 20,}}
	local busyPart = nil
	local busyPart2 = nil
	local SpeedDistance = 0
	local AEBActive = false
	local BSMLeft = false
	local BSMRight = false
	local AEBBrake = 0
	local AEBFull = false
	local ACCEnabled = false
	local ACCOriginalSpeed = 75
	local ACCSpeed = ACCOriginalSpeed
	local ACCStop = false
	local bsmbusyPart = nil
	script.Parent.CruiseControl.Set.MouseButton1Down:Connect(function()
		if UNITS[1].scaling*car.DriveSeat.Velocity.Magnitude > 2 then
			ACCOriginalSpeed = UNITS[1].scaling*car.DriveSeat.Velocity.Magnitude
			ACCEnabled = true
			script.Parent.CruiseControl.CruiseSpeed.TextColor3 = Color3.fromRGB(255, 85, 0)
			script.Parent.CruiseControl.Return.ImageColor3 = Color3.fromRGB(255, 85, 0)
			car.Body.Display.GaugeDisplay.BMWGauges.BMWSystem.SymbolLights.CruiseControl.Visible = true
			car.Body.Display.GaugeDisplay.BMWGauges.BMWSystem.SymbolLights.CruiseControl2.Visible = true
			script.Parent.CruiseControl.CruiseSpeed.Text = math.floor(ACCOriginalSpeed)
		end
	end)
	script.Parent.CruiseControl.Res.MouseButton1Down:Connect(function()
		ACCEnabled = true
		script.Parent.CruiseControl.CruiseSpeed.Text = math.floor(ACCOriginalSpeed)
		script.Parent.CruiseControl.CruiseSpeed.TextColor3 = Color3.fromRGB(255, 85, 0)
		script.Parent.CruiseControl.Return.ImageColor3 = Color3.fromRGB(255, 85, 0)
		car.Body.Display.GaugeDisplay.BMWGauges.BMWSystem.SymbolLights.CruiseControl.Visible = true
		car.Body.Display.GaugeDisplay.BMWGauges.BMWSystem.SymbolLights.CruiseControl2.Visible = true
	end)
	script.Parent.CruiseControl.Up.MouseButton1Down:Connect(function()
		ACCOriginalSpeed = ACCOriginalSpeed + 1
		script.Parent.CruiseControl.CruiseSpeed.Text = math.floor(ACCOriginalSpeed)
	end)
	script.Parent.CruiseControl.Return.MouseButton1Down:Connect(function()
		if ACCEnabled == true then
			ACCEnabled = false
			_GThrot = 0
			script.Parent.CruiseControl.CruiseSpeed.Text = math.floor(ACCOriginalSpeed)
			if (ACCStop == true or ACCEasyBrake == true) then
				ACCStop = false
				ACCEasyBrake = false
				_GBrake = 0
			end
			script.Parent.CruiseControl.CruiseSpeed.TextColor3 = Color3.fromRGB(255,255,255)
			script.Parent.CruiseControl.Return.ImageColor3 = Color3.fromRGB(255,255,255)
			car.Body.Display.GaugeDisplay.BMWGauges.BMWSystem.SymbolLights.CruiseControl.Visible = false
			car.Body.Display.GaugeDisplay.BMWGauges.BMWSystem.SymbolLights.CruiseControl2.Visible = false

		else
			ACCEnabled = true
			script.Parent.CruiseControl.CruiseSpeed.Text = math.floor(ACCOriginalSpeed)
			script.Parent.CruiseControl.CruiseSpeed.TextColor3 = Color3.fromRGB(255, 85, 0)
			script.Parent.CruiseControl.Return.ImageColor3 = Color3.fromRGB(255, 85, 0)
			car.Body.Display.GaugeDisplay.BMWGauges.BMWSystem.SymbolLights.CruiseControl.Visible = true
			car.Body.Display.GaugeDisplay.BMWGauges.BMWSystem.SymbolLights.CruiseControl2.Visible = true
		end
	end)
	script.Parent.CruiseControl.Down.MouseButton1Down:Connect(function()
		ACCOriginalSpeed = ACCOriginalSpeed - 1
		script.Parent.CruiseControl.CruiseSpeed.Text = math.floor(ACCOriginalSpeed)
		if ACCOriginalSpeed <= 2 then
			ACCEnabled = false
			_GThrot = 0
			if (ACCStop == true or ACCEasyBrake == true) then
				ACCStop = false
				ACCEasyBrake = false
				_GBrake = 0
			end
			script.Parent.CruiseControl.CruiseSpeed.TextColor3 = Color3.fromRGB(255,255,255)
			script.Parent.CruiseControl.Return.ImageColor3 = Color3.fromRGB(255,255,255)
			car.Body.Display.GaugeDisplay.BMWGauges.BMWSystem.SymbolLights.CruiseControl.Visible = false
			car.Body.Display.GaugeDisplay.BMWGauges.BMWSystem.SymbolLights.CruiseControl2.Visible = false
		end
	end)
	--Bertox part end
	-- ~15 c/s

	while wait(.0667) do
		--Flip
		if _Tune.AutoFlip then Flip() end

		--[[Bertox'Scripts begins here]]

	    --AEB
		if _GBrake > 0 and AEBBrake == 0 and ACCStop == false and ACCEasyBrake == false and AEBFull == false and AEBActive == false then
			ACCEnabled = false
			_GThrot = 0
			if ACCStop == true then
				ACCStop = false
				_GBrake = 0
			end
			car.Body.Display.GaugeDisplay.BMWGauges.BMWSystem.SymbolLights.CruiseControl.Visible = false
			car.Body.Display.GaugeDisplay.BMWGauges.BMWSystem.SymbolLights.CruiseControl2.Visible = false
			script.Parent.CruiseControl.CruiseSpeed.TextColor3 = Color3.fromRGB(255,255,255)
			script.Parent.CruiseControl.Return.ImageColor3 = Color3.fromRGB(255,255,255)
		end
		busyPart = nil
		busyPart2 = nil
		bsmbusyPart = nil
		speed = UNITS[1].scaling*car.DriveSeat.Velocity.Magnitude
		for i,v in pairs(car.Body.Rays:GetChildren()) do
			if speed > 40 then
				ray = Ray.new(v.Position, v.CFrame.lookVector*(speed*speed+speed)/50)
			elseif speed <= 40 then
				ray = Ray.new(v.Position, v.CFrame.lookVector*(speed*speed+speed )/50)
			end
			local part, endPoint = workspace:FindPartOnRayWithIgnoreList(ray,{car.Body,car.Wheels,car.Misc})
			if part then
				if part.Anchored == false then
					busyPart = part
				end
			end
		end
		if busyPart and speed > 3 and (speed < 60 or ACCEnabled == true) and _GSteerT == 0 and _CGear > 0 and car.DriveSeat.Values.AEBisOn.Value == true and car.Electrics.Value == true then
			--print("BLOCKING PART: " ,busyPart.Name, " DISTANCE: " , math.floor((busyPart.Position - car.DriveSeat.Position).Magnitude), " CAR SPEED: ", math.floor(speed), "  -  ", math.floor((busyPart.Position - car.DriveSeat.Position).Magnitude-speed))
			_GBrake = 1
			car.SafetySystems:FireServer("AEB",true)
			_GThrot = 0
			AEBActive = true
			if ACCEnabled == false then
				if AEBBrake == 0 then
					script.AssistantAlarm:Play()
					car.Body.Display.GaugeDisplay.BMWGauges.BMWSystem.SymbolLights.BRAKE.Visible = true
					script.Parent.AC6_Stock_Gauges.EBrake.Visible = true
				end
			end
			AEBBrake = 1
			if busyPart.Velocity.Magnitude <= 3 then
				AEBFull = true
			elseif ACCEnabled == true then
				TargetSpeed = UNITS[1].scaling*busyPart.Velocity.Magnitude
				ACCSpeed = TargetSpeed
			end
		elseif AEBActive == true then
			AEBActive = false
		elseif AEBActive == false and AEBBrake == 1 then
			AEBBrake = 2
		elseif AEBActive == false and AEBBrake == 2 and AEBFull == false then
			AEBBrake = 0
			car.SafetySystems:FireServer("AEB",false)
			script.Parent.AC6_Stock_Gauges.EBrake.Visible = false
			car.Body.Display.GaugeDisplay.BMWGauges.BMWSystem.SymbolLights.BRAKE.Visible = false
			_GBrake = 0
		elseif AEBFull == true and speed <= 0.1 then
			AEBFull = false
			_GBrake = 0
		elseif ACCEnabled == true then
			if speed < ACCSpeed-5 and ACCStop == false and AEBBrake == 0 then
				_GThrot = 1
				_GBrake = 0
				ACCEasyBrake = false
			elseif speed < ACCSpeed and ACCStop == false and AEBBrake == 0 then
				_GThrot = 0.3
				_GBrake = 0
				ACCEasyBrake = false
			elseif speed > ACCSpeed+5 and ACCStop == false and AEBBrake == 0 then
				_GThrot = 0
				_GBrake = 1
				ACCEasyBrake = true
			elseif speed > ACCSpeed+3 and ACCStop == false and AEBBrake == 0 then
				_GThrot = 0
				_GBrake = 0.4
				ACCEasyBrake = true
			elseif speed > ACCSpeed+2 and ACCStop == false and AEBBrake == 0 then
				_GThrot = 0
				_GBrake = 0.1
				ACCEasyBrake = true
			elseif ACCStop == false and AEBBrake == 0 then
				_GThrot = 0.08
				_GBrake = 0
				ACCEasyBrake = false
			end
			if AEBBrake == 0 then
				if ACCStop == false then
					for i,v in pairs(car.Body.Rays:GetChildren()) do
						if speed > 40 then
							ray = Ray.new(v.Position, v.CFrame.lookVector*(speed*speed+speed)/25)
						elseif speed <= 40 then
							ray = Ray.new(v.Position, v.CFrame.lookVector*(speed*speed+speed )/10)
						end
						local part, endPoint = workspace:FindPartOnRayWithIgnoreList(ray,{car.Body,car.Wheels,car.Misc})
						if part then
							if part.Anchored == false then
								busyPart2 = part
							end
						end
					end
				else
					for i,v in pairs(car.Body.Rays:GetChildren()) do
						ray = Ray.new(v.Position, v.CFrame.lookVector*20)
						local part, endPoint = workspace:FindPartOnRayWithIgnoreList(ray,{car.Body,car.Wheels,car.Misc})
						if part then
							if part.Anchored == false then
								busyPart2 = part
							end
						end
					end
				end
				if busyPart2 == nil then
					ACCSpeed = ACCOriginalSpeed
					if ACCEasyBrake == false then
						_GBrake = 0
					end
					ACCStop = false
				elseif busyPart2.Velocity.Magnitude < 3 then
					ACCStop = true
					_GThrot = 0
					_GBrake = 1
					ACCSpeed = UNITS[1].scaling*busyPart2.Velocity.Magnitude
				else
					ACCStop = false
					ACCSpeed = UNITS[1].scaling*busyPart2.Velocity.Magnitude
				end
			end
				end
		BSMLeft = false
		BSMRight = false
		for i,v in pairs(car.Body.BSM:GetChildren()) do
			ray = Ray.new(v.Position, v.CFrame.lookVector*25)
			local part, endPoint = workspace:FindPartOnRayWithIgnoreList(ray,{car.Body,car.Wheels,car.Misc})
			if part then
				if part.Anchored == false then
					bsmbusyPart = part
					if v.Name:sub(1,1) == "L" then
						BSMLeft = true
					else
						BSMRight = true
					end
				end
			end
		end
		car.SafetySystems:FireServer("BSM",BSMLeft,BSMRight)
		--[[Bertox'Scripts ends here]]
	end