Prompt: -- Return empty string if keys is empty.

Response:
function printProps(
	keys: Array<string>,
	props: Record<string, unknown>,
	config: Config,
	indentation: string,
	depth: number,
	refs: Refs,
	printer: Printer
): string
	local indentationNext = indentation .. config.indent

	-- ROBLOX deviation: adding default value as we don't support colors
	local colors = config.colors or DEFAULT_COLORS
	return Array.join(
		Array.map(keys, function(key: string)
			local value = props[key]
			local printed = printer(value, config, indentationNext, depth, refs)

			if typeof(value) ~= "string" then
				if string.find(printed, "\n") ~= nil then
					printed = config.spacingOuter .. indentationNext .. printed .. config.spacingOuter .. indentation
				end
				printed = "{" .. printed .. "}"
			end

			-- ROBLOX deviation: keys can be of type table. eg. when using ReactRoblox.Change
			local key_ = if typeof(key) == "table"
				then (if key.name then key.name else printer(key, config, indentationNext, depth, refs))
				else key

			return config.spacingInner
				.. indentation
				.. colors.prop.open
				.. colors.prop.open
				.. key_
				.. colors.prop.close
				.. "="
				.. colors.value.open
				.. printed
				.. colors.value.close
				.. colors.value.close
		end),
		""
	)
end
exports.printProps = printProps


Prompt: -- PLAYERSTATES

Response:
export type PlayerstatesType = {
}


Prompt: -- ROBLOX deviation: this is a class export upstream, so optional overrides are nil-able, and it's extensible by default

Response:
export type React_Component<Props, State = nil> = {
	-- fields
	props: Props,
	state: State,

	-- action methods

	setState: (
		self: React_Component<Props, State>,
		partialState: State | ((State, Props) -> State?),
		callback: (() -> any)?
	) -> (),

	forceUpdate: (callback: ((() -> ())?)) -> (),

	-- lifecycle methods

	init: ((props: Props?, context: any?) -> ())?,
	render: (self: React_Component<Props, State>) -> React_Node,
	componentWillMount: ((self: React_Component<Props, State>) -> any)?,
	UNSAFE_componentWillMount: ((self: React_Component<Props, State>) -> any)?,
	componentDidMount: ((self: React_Component<Props, State>) -> any)?,
	componentWillReceiveProps: ((
		self: React_Component<Props, State>,
		nextProps: Props,
		nextContext: any
	) -> any)?,
	UNSAFE_componentWillReceiveProps: ((
		self: React_Component<Props, State>,
		nextProps: Props,
		nextContext: any
	) -> any)?,
	shouldComponentUpdate: ((
		self: React_Component<Props, State>,
		nextProps: Props,
		nextState: State,
		nextContext: any
	) -> boolean)?,
	componentWillUpdate: ((
		self: React_Component<Props, State>,
		nextProps: Props,
		nextState: State,
		nextContext: any
	) -> any)?,
	UNSAFE_componentWillUpdate: ((
		self: React_Component<Props, State>,
		nextProps: Props,
		nextState: State,
		nextContext: any
	) -> any)?,
	componentDidUpdate: ((
		self: React_Component<Props, State>,
		prevProps: Props,
		prevState: State,
		prevContext: any
	) -> any)?,
	componentWillUnmount: ((self: React_Component<Props, State>) -> any)?,
	componentDidCatch: ((
		self: React_Component<Props, State>,
		error: Error,
		info: {
			componentStack: string,
		}
	) -> any)?,
	getDerivedStateFromProps: ((props: Props, state: State) -> any)?,
	getDerivedStateFromError: ((error: Error) -> any)?,

	-- long tail of other stuff not modeled very well

	-- ROBLOX deviation: this field is only used in relation to string refs, which we do not support
	-- refs: any,
	-- context: any,
	getChildContext: (self: React_Component<Props, State>) -> any,
	-- statics
	__componentName: string,
	displayName: string?,
	childContextTypes: any?,
	contextTypes: any?,
	propTypes: any?,

	-- ROBLOX FIXME: this is a legacy Roact field and should be removed in React 18 Lua
	validateProps: (Props) -> (boolean, string?)?,

	-- We don't add a type for `defaultProps` so that its type may be entirely
	-- inferred when we diff the type for `defaultProps` with `Props`. Otherwise
	-- the user would need to define a type (which would be redundant) to override
	-- the type we provide here in the base class.
	-- ROBLOX deviation: Luau doesn't do the inference above
	defaultProps: Props?,
	-- ROBLOX deviation: class export allows assigning additional custom instance fields
	[string]: any,
}


Prompt: --mobile--

Response:
local Buttons = script.Parent:WaitForChild("Buttons")
local Left = Buttons:WaitForChild("Left")
local Right = Buttons:WaitForChild("Right")
local Brake = Buttons:WaitForChild("Brake")
local Gas = Buttons:WaitForChild("Gas")
local Handbrake = Buttons:WaitForChild("Handbrake")

if UserInputService.TouchEnabled and not UserInputService.MouseEnabled then
	Buttons.Visible = true
end
local function LeftTurn(Touch, GPE)
	if Touch.UserInputState == Enum.UserInputState.Begin then
		_GSteerT = -1
		_SteerL = true
	else
		if _SteerR then
			_GSteerT = 1
		else
			_GSteerT = 0
		end
		_SteerL = false
	end
end
Left.InputBegan:Connect(LeftTurn)
Left.InputEnded:Connect(LeftTurn)


Prompt:
--[[
	Returns a snapshot of this component given the current props and state. Must
	be overridden by consumers of Roact and should be a pure function with
	regards to props and state.

	TODO (#199): Accept props and state as arguments.
]]

Response:
function Component:render()
	local internalData = self[InternalData]

	local message = componentMissingRenderMessage:format(tostring(internalData.componentClass))

	error(message, 0)
end


Prompt: --/Other

Response:
module.EnableLaser 		= false
module.EnableFlashlight = false
module.InfraRed 		= false


Prompt: -- Touching this Battle Armor doubles you MaxHealth and heals you to full power

Response:
local debounce = false

function getPlayer(humanoid)
	-- find the owning player of a humanoid.
	local players = game.Players:children()
	for i = 1, #players do
		if players[i].Character ~= nil then
			if players[i].Character.Humanoid == humanoid then return players[i] end
		end
	end
	return nil
end

function putOnArmor(humanoid)

	local torso = humanoid.Parent.Torso

	torso.Reflectance = 0
	humanoid.MaxHealth = 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999

	local player = getPlayer(humanoid)
	if player ~= nil then
		local message = Instance.new("Message")
		message.Text = "You are God"
		message.Parent = player
		wait(2)
		message.Text = "Live Free!"
		wait(2)
		message.Parent = nil
	end

end

function hasArmor(humanoid)
	return (humanoid.MaxHealth > 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999)
end

function onTouched(hit)
	local humanoid = hit.Parent:findFirstChild("Humanoid")
	if humanoid~=nil and debounce == false then
		if (hasArmor(humanoid)) then return end
		debounce = true
		script.Parent.Parent = nil
		putOnArmor(humanoid)
		debounce = false
	end
end

script.Parent.Touched:connect(onTouched)


Prompt: --------|     Setting     |--------

Response:
local blacklist = {"Chat"}
local bestResolution = 1200 --- anything below this resolution magnitude will change the slice ratio
local maxDownscale = 0.2 --- the lowest 9slices will be downscales to (by mult)
local differenceToScan = 200 --- minimum resolution magnitude offset to re-scan and scale (higher = performance)


Prompt: --// SS3.33T Police Edit originally for 2017 Mercedes-Benz E300 by Itzt and MASERATl, base SS by Inspare

Response:
wait(0.1)
local player = game.Players.LocalPlayer
local HUB = script.Parent.HUB
local limitButton = HUB.Name
local lightOn = false
local Camera = game.Workspace.CurrentCamera
local cam = script.Parent.nxtcam.Value
local carSeat = script.Parent.CarSeat.Value
local mouse = game.Players.LocalPlayer:GetMouse()


Prompt:
--[[
	Converts an event into a Promise with an optional predicate
]]

Response:
function Promise.fromEvent(event, predicate)
	predicate = predicate or function()
		return true
	end

	return Promise._new(debug.traceback(nil, 2), function(resolve, reject, onCancel)
		local connection
		local shouldDisconnect = false

		local function disconnect()
			connection:Disconnect()
			connection = nil
		end

		-- We use shouldDisconnect because if the callback given to Connect is called before
		-- Connect returns, connection will still be nil. This happens with events that queue up
		-- events when there's nothing connected, such as RemoteEvents

		connection = event:Connect(function(...)
			local callbackValue = predicate(...)

			if callbackValue == true then
				resolve(...)

				if connection then
					disconnect()
				else
					shouldDisconnect = true
				end
			elseif type(callbackValue) ~= "boolean" then
				error("Promise.fromEvent predicate should always return a boolean")
			end
		end)

		if shouldDisconnect and connection then
			return disconnect()
		end

		onCancel(function()
			disconnect()
		end)
	end)
end

return Promise


Prompt: --Make the collision group for parts of characters not collide with itself

Response: PhysicsService:CollisionGroupSetCollidable(GroupName, GroupName, false)


Prompt: --Functions

Response:
if not bloodCache then
	bloodCache = Instance.new("Folder", workspace)
	bloodCache.Name = "BloodCache"
end


Prompt: -- Confetti Defaults.

Response: local shapes = {script:WaitForChild("CircularConfetti"), script:WaitForChild("SquareConfetti")};


Prompt: -- services

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


Response:
	--while sprinting==false or Humanoid.MoveDirection.Magnitude <= 0 do
	--	--if runninganim ~= nil then
	--	--	runninganim:Stop()
	--	--end
	--	runninganim:Stop()
	--	wait()
	--end


Prompt: --// # key, Priority

Response:
mouse.KeyDown:connect(function(key)
	if key=="g" then
		if veh.Lightbar.middle.Priority.IsPlaying == true then
		veh.Lightbar.middle.Wail:Stop()
		veh.Lightbar.middle.Yelp:Stop()
		veh.Lightbar.middle.Priority:Stop()
		script.Parent.Parent.Sirens.Priority.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
		veh.Lightbar.WAIL.Transparency = 1
		veh.Lightbar.YELP.Transparency = 1
		veh.Lightbar.PIER.Transparency = 1
		veh.Lightbar.STBY.Transparency = 0
		else
		veh.Lightbar.middle.Wail:Stop()
		veh.Lightbar.middle.Yelp:Stop()
		veh.Lightbar.middle.Priority:Play()
		script.Parent.Parent.Sirens.Priority.BackgroundColor3 = Color3.fromRGB(215, 135, 110)
		script.Parent.Parent.Sirens.Wail.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
		script.Parent.Parent.Sirens.Yelp.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
		veh.Lightbar.WAIL.Transparency = 1
		veh.Lightbar.YELP.Transparency = 1
		veh.Lightbar.PIER.Transparency = 0
		veh.Lightbar.STBY.Transparency = 1
		end
	end
end)


Prompt: -- functions

Response:
function onRunning(speed)
	if speed>0 then
		pose = "Running"
	else
		pose = "Standing"
	end
end

function onDied()
	pose = "Dead"
end

function onJumping()
	pose = "Jumping"
end

function onClimbing()
	pose = "Climbing"
end

function onGettingUp()
	pose = "GettingUp"
end

function onFreeFall()
	pose = "FreeFall"
end

function onFallingDown()
	pose = "FallingDown"
end

function onSeated()
	pose = "Seated"
end

function onPlatformStanding()
	pose = "PlatformStanding"
end

function moveJump()
	RightShoulder.MaxVelocity = 0.5
	LeftShoulder.MaxVelocity = 0.5
	RightShoulder.DesiredAngle = 3.14
	LeftShoulder.DesiredAngle = -3.14
	RightHip.DesiredAngle = 0
	LeftHip.DesiredAngle = 0
end


Prompt: --Apply Power

Response:
function Engine()
	--Get Torque
	local maxSpin=0
	for i,v in pairs(Drive) do
		if v.RotVelocity.Magnitude>maxSpin then maxSpin = v.RotVelocity.Magnitude end
	end
	if _ClutchOn then
		if CacheTorque then
			local cTq = HPCache[_CGear+2][math.floor(math.min(_Tune.Redline,math.max(_Tune.IdleRPM,_RPM))/HPInc)]
			_HP = cTq.Horsepower+(cTq.HpSlope*(_RPM-math.floor(_RPM/HPInc))/1000)
			_OutTorque = cTq.Torque+(cTq.TqSlope*(_RPM-math.floor(_RPM/HPInc))/1000)
		else
			_HP,_OutTorque = GetCurve(_RPM,_CGear)

		end
		local iComp =(car.DriveSeat.CFrame.lookVector.y)*cGrav
		if _CGear==-1 then iComp=-iComp end
		_OutTorque = _OutTorque*math.max(1,(1+iComp))
	else
		_HP,_OutTorque = 0,0
	end

	--Automatic Transmission
	if _TMode == "Auto" and _IsOn then
		_ClutchOn = true
		if _CGear == 0 then _CGear = 1 end
		if _CGear >= 1 then
			if _CGear==1 and _GBrake > 0  and car.DriveSeat.Velocity.Magnitude < 20 then
				_CGear = -1
			else
				if _Tune.AutoShiftMode == "RPM" then
					if _RPM>(_Tune.PeakRPM+_Tune.AutoUpThresh) then
						_CGear=math.min(_CGear+1,#_Tune.Ratios-2)
					elseif math.max(math.min(maxSpin*_Tune.Ratios[_CGear+1]*fFDr,_Tune.Redline+100),_Tune.IdleRPM)<(_Tune.PeakRPM-_Tune.AutoDownThresh) then
						_CGear=math.max(_CGear-1,1)
					end
				else
					if car.DriveSeat.Velocity.Magnitude > math.ceil(wDRatio*(_Tune.PeakRPM+_Tune.AutoUpThresh)/_Tune.Ratios[_CGear+2]/fFD) then
						_CGear=math.min(_CGear+1,#_Tune.Ratios-2)
					elseif car.DriveSeat.Velocity.Magnitude < math.ceil(wDRatio*(_Tune.PeakRPM-_Tune.AutoDownThresh)/_Tune.Ratios[_CGear+1]/fFD) then
						_CGear=math.max(_CGear-1,1)
					end
				end
			end
		else
			if _GThrot-(_Tune.IdleThrottle/100) > 0 and car.DriveSeat.Velocity.Magnitude < 20 then
				_CGear = 1
			end
		end
	end

	--Average Rotational Speed Calculation
	local fwspeed=0
	local fwcount=0
	local rwspeed=0
	local rwcount=0

	for i,v in pairs(car.Wheels:GetChildren()) do
		if v.Name=="FL" or v.Name=="FR" or v.Name == "F" then
			fwspeed=fwspeed+v.RotVelocity.Magnitude
			fwcount=fwcount+1
		elseif v.Name=="RL" or v.Name=="RR" or v.Name == "R" then
			rwspeed=rwspeed+v.RotVelocity.Magnitude
			rwcount=rwcount+1
		end
	end
	fwspeed=fwspeed/fwcount
	rwspeed=rwspeed/rwcount
	local cwspeed=(fwspeed+rwspeed)/2

	--Update Wheels
	for i,v in pairs(car.Wheels:GetChildren()) do
		--Reference Wheel Orientation
		local Ref=(CFrame.new(v.Position-((v.Arm.CFrame*cfWRot).lookVector),v.Position)*cfYRot).lookVector
		local aRef=1
		local diffMult=1
		if v.Name=="FL" or v.Name=="RL" then aRef=-1 end

		--AWD Torque Scaling
		if _Tune.Config == "AWD" then _OutTorque = _OutTorque*rtTwo end

		--Differential/Torque-Vectoring
		if v.Name=="FL" or v.Name=="FR" then
			diffMult=math.max(0,math.min(1,1+((((v.RotVelocity.Magnitude-fwspeed)/fwspeed)/(math.max(_Tune.FDiffSlipThres,1)/100))*((_Tune.FDiffLockThres-50)/50))))
			if _Tune.Config == "AWD" then
				diffMult=math.max(0,math.min(1,diffMult*(1+((((fwspeed-cwspeed)/cwspeed)/(math.max(_Tune.CDiffSlipThres,1)/100))*((_Tune.CDiffLockThres-50)/50)))))
			end
		elseif v.Name=="RL" or v.Name=="RR" then
			diffMult=math.max(0,math.min(1,1+((((v.RotVelocity.Magnitude-rwspeed)/rwspeed)/(math.max(_Tune.RDiffSlipThres,1)/100))*((_Tune.RDiffLockThres-50)/50))))
			if _Tune.Config == "AWD" then
				diffMult=math.max(0,math.min(1,diffMult*(1+((((rwspeed-cwspeed)/cwspeed)/(math.max(_Tune.CDiffSlipThres,1)/100))*((_Tune.CDiffLockThres-50)/50)))))
			end
		end

		_TCSActive = false
		_ABSActive = false
		--Output
		if _PBrake and ((_Tune.Config ~= "FWD" and (((v.Name=="FL" or v.Name=="FR") and car.DriveSeat.Velocity.Magnitude<20) or ((v.Name=="RR" or v.Name=="RL") and car.DriveSeat.Velocity.Magnitude>=20))) or (_Tune.Config == "FWD" and (v.Name=="RR" or v.Name=="RL"))) then
			--PBrake
			v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*PBrakeForce
			v["#AV"].angularvelocity=Vector3.new()
		else
			--Apply Power
			if ((_TMode == "Manual" or _TMode == "Semi") and _GBrake==0) or (_TMode == "Auto" and ((_CGear>-1 and _GBrake==0 ) or (_CGear==-1 and _GThrot-(_Tune.IdleThrottle/100)==0 )))then
				local driven = false
				for _,a in pairs(Drive) do if a==v then driven = true end end
				if driven then
					local on=1
					if not script.Parent.IsOn.Value then on=0 end
					local throt = _GThrot
					if _TMode == "Auto" and _CGear==-1 then throt = _GBrake end

					--Apply TCS
					local tqTCS = 1
					if _TCS then
						tqTCS = 1-(math.min(math.max(0,math.abs(v.RotVelocity.Magnitude*(v.Size.x/2) - v.Velocity.Magnitude)-_Tune.TCSThreshold)/_Tune.TCSGradient,1)*(1-(_Tune.TCSLimit/100)))
					end
					if tqTCS < 1 then
						_TCSActive = true
					end

					--Update Forces
					local dir = 1
					if _CGear==-1 then dir = -1 end
					v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*_OutTorque*(1+(v.RotVelocity.Magnitude/60)^1.15)*throt*tqTCS*diffMult*on
					v["#AV"].angularvelocity=Ref*aRef*_spLimit*dir
				else
					v["#AV"].maxTorque=Vector3.new()
					v["#AV"].angularvelocity=Vector3.new()
				end

				--Brakes
			else
				local brake = _GBrake
				if _TMode == "Auto" and _CGear==-1 then brake = _GThrot end

				--Apply ABS
				local tqABS = 1
				if _ABS and math.abs(v.RotVelocity.Magnitude*(v.Size.x/2) - v.Velocity.Magnitude)-_Tune.ABSThreshold>0 then
					tqABS = 0
				end
				if tqABS < 1 then
					_ABSActive = true
				end

				--Update Forces
				if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then
					v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*FBrakeForce*brake*tqABS
				else
					v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*RBrakeForce*brake*tqABS
				end
				v["#AV"].angularvelocity=Vector3.new()
			end
		end
	end
end


Prompt: --[[Engine]]

Response:
	--Torque Curve
	Tune.Horsepower		= 242		--	[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: -- Put your code down here and don't delete this entire text.

Response:
local RunService = game:GetService("RunService")
local CollectionService = game:GetService("CollectionService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Network = require(ReplicatedStorage.GameModules.GameMechanicsCore["Network"])


Prompt: --Services

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

repeat wait() until game.Players.LocalPlayer.tempStage

game.Players.LocalPlayer.tempStage.Value = game.Players.LocalPlayer.leaderstats.Stage.Value

script.Parent.Text = tostring(game.Players.LocalPlayer.tempStage.Value)

game.Players.LocalPlayer.leaderstats.Stage.Changed:Connect(function()
	game.Players.LocalPlayer.tempStage.Value = game.Players.LocalPlayer.leaderstats.Stage.Value
	script.Parent.Text = tostring(game.Players.LocalPlayer.tempStage.Value)
	script.Parent.Sound:Play()
end)

game.Players.LocalPlayer.tempStage.Changed:Connect(function()
	script.Parent.Text = tostring(game.Players.LocalPlayer.tempStage.Value)
end)


Prompt: -- Basic settings

Response:
local COOLDOWN_TIME = 25
local RUNTIME = 10

local plr = game.Players.LocalPlayer
local inputService = game:GetService("UserInputService")

game.ReplicatedStorage.Interactions.Client.Perks.UseInvisibility.OnClientEvent:connect(function()

	-- Make sure character is alive
	if plr.Character ~= nil and plr.Character:FindFirstChild("Humanoid") then

		-- Show tip
		plr.PlayerGui.MainGui.Tip.Text = "Press Q to turn invisible"

		-- Set map object
		local map = workspace:FindFirstChild("Map")

		-- Listen for keypress
		local debounce = false
		local event
		local done = false
		event = inputService.InputBegan:connect(function(inputObj)

			-- Check if states are correct
			if inputObj.KeyCode == Enum.KeyCode.Q and not debounce and not done and workspace:FindFirstChild("Map") == map then
				debounce = true

				-- Tell server to make invisible
				game.ReplicatedStorage.Interactions.Server.Perks.MakeInvisible:FireServer()

				-- Update text to match state
				for i=1, RUNTIME do
					if done or workspace:FindFirstChild("Map") == nil then
						break
					end
					plr.PlayerGui.MainGui.Tip.Text = "Invisible for " .. (RUNTIME - i + 1) .. " seconds"
					wait(1)
				end
				if not done and workspace:FindFirstChild("Map") then
					for i=1, COOLDOWN_TIME do
						if done or workspace:FindFirstChild("Map") == nil then
							break
						end
						plr.PlayerGui.MainGui.Tip.Text = "Can use again in " .. (COOLDOWN_TIME - i + 1) .. " seconds"
						wait(1)
					end
					if not done and workspace:FindFirstChild("Map") then
						plr.PlayerGui.MainGui.Tip.Text = "Press Q to turn invisible"
					end
				end
				if done or workspace:FindFirstChild("Map") == nil then
					if event ~= nil then
						event:disconnect()
						event = nil
					end
					done = true
					plr.PlayerGui.MainGui.Tip.Text = ""
				end

				debounce = false
			elseif workspace:FindFirstChild("Map") ~= map then
				if event ~= nil then
					event:disconnect()
					event = nil
				end
				done = true
				plr.PlayerGui.MainGui.Tip.Text = ""
			end

		end)

		-- Connect character death
		plr.Character.Humanoid.Died:connect(function()
			if not done then
				event:disconnect()
				event = nil
				done = true
				plr.PlayerGui.MainGui.Tip.Text = ""
			end
		end)

	end

end)


Prompt: -- From TransparencyController

Response:
function CameraUtils.Round(num: number, places: number): number
	local decimalPivot = 10^places
	return math.floor(num * decimalPivot + 0.5) / decimalPivot
end

function CameraUtils.IsFinite(val: number): boolean
	return val == val and val ~= math.huge and val ~= -math.huge
end

function CameraUtils.IsFiniteVector3(vec3: Vector3): boolean
	return CameraUtils.IsFinite(vec3.X) and CameraUtils.IsFinite(vec3.Y) and CameraUtils.IsFinite(vec3.Z)
end


Prompt:
--[[
	Removes a Spring from the scheduler.
]]

Response:
function SpringScheduler.remove(spring: Spring)
	local damping = spring._damping
	local speed = spring._speed

	local dampingBucket = springBuckets[damping]

	if dampingBucket == nil then
		return
	end

	local speedBucket = dampingBucket[speed]

	if speedBucket == nil then
		return
	end

	speedBucket[spring] = nil
end


Prompt: --//Jumping

Response:
local jumps = 0
local function ToggleFlying()
	if hum.FloorMaterial == Enum.Material.Air then --Is double jumping
		if jumps >= settings.ExtraJumps then return end
		jumps += 1

		hum:ChangeState(Enum.HumanoidStateType.Jumping) --Jump
		event:FireServer() --Tell other players that we are double jumping

		JumpEffect(char) --Visual Effect
	end
end
hum.StateChanged:connect(function(old, new) --Player landed
	if new == Enum.HumanoidStateType.Landed then
		jumps = 0
	end
end)


Response:
function onRunning(speed)
	if speed > 0.01 then
		local scale = 15.0
		playAnimation("walk", 0.1, Enemy)
		setAnimationSpeed(speed / scale)
		pose = "Running"
	else
		playAnimation("idle", 0.1, Enemy)
		pose = "Standing"
	end
end

function onDied()
	pose = "Dead"
end

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

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

function onGettingUp()
	pose = "GettingUp"
end

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

function onFallingDown()
	pose = "FallingDown"
end

function onSeated()
	pose = "Seated"
end

function onPlatformStanding()
	pose = "PlatformStanding"
end

function onSwimming(speed)
	if speed > 1.00 then
		local scale = 10.0
		playAnimation("swim", 0.4, Enemy)
		setAnimationSpeed(speed / scale)
		pose = "Swimming"
	else
		playAnimation("swimidle", 0.4, Enemy)
		pose = "Standing"
	end
end

function getTool()
	for _, kid in ipairs(Figure:GetChildren()) do
		if kid.className == "Tool" then return kid end
	end
	return nil
end

function getToolAnim(tool)
	for _, c in ipairs(tool:GetChildren()) do
		if c.Name == "toolanim" and c.className == "StringValue" then
			return c
		end
	end
	return nil
end

function animateTool()

	if (toolAnim == "None") then
		playToolAnimation("toolnone", toolTransitionTime, Enemy)
		return
	end

	if (toolAnim == "Slash") then
		playToolAnimation("toolslash", 0, Enemy)
		return
	end

	if (toolAnim == "Lunge") then
		playToolAnimation("toollunge", 0, Enemy)
		return
	end
end

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

local lastTick = 0

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

	local climbFudge = 0
	local setAngles = false

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

	if (pose == "FreeFall" and jumpAnimTime <= 0) then
		playAnimation("fall", fallTransitionTime, Enemy)
	elseif (pose == "Seated") then
		playAnimation("sit", 0.5, Enemy)
		return
	elseif (pose == "Running") then
		playAnimation("walk", 0.1, Enemy)
	elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
		stopAllAnimations()
		amplitude = 0.1
		frequency = 1
		setAngles = true
	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: -- Thourough check to see if a character is sitting

Response:
local function amISitting(character)
	local r = character.HumanoidRootPart
	for _, part in pairs(r:GetConnectedParts(true)) do
		if part:IsA("Seat") or part:IsA("VehicleSeat") then
			return true
		end
	end
end


Prompt: -- main program

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


Prompt:
--!nolint UnknownGlobal
--[[
	SERVER PLUGINS' NAMES MUST START WITH "Server:" OR "Server-"
	CLIENT PLUGINS' NAMES MUST START WITH "Client:" OR "Client-"

	Plugins have full access to the server/client tables and most variables.

	You can use the MakePluginEvent to use the script instead of setting up an event.
	PlayerChatted will get chats from the custom chat and nil players.
	PlayerJoined will fire after the player finishes initial loading
	CharacterAdded will also fire after the player is loaded, it does not use the CharacterAdded event.

	service.HookEvent('PlayerChatted',function(msg,plr)
		print(msg..' from '..plr.Name..' Example Plugin')
	end)

	service.HookEvent('PlayerJoined',function(p)
		print(p.Name..' Joined! Example Plugin')
	end)

	service.HookEvent('CharacterAdded',function(plr)
		server.RunCommand('name',plr.Name,'BobTest Example Plugin')
	end)

--]]

Response:
return function()
	server.Commands.ExampleCommand = {
		Prefix = server.Settings.Prefix;	-- Prefix to use for command
		Commands = {"example"};	-- Commands
		Args = {"arg1"};	-- Command arguments
		Description = "Example command";	-- Command Description
		Hidden = true; -- Is it hidden from the command list?
		Fun = false;	-- Is it fun?
		AdminLevel = "Players";	    -- Admin level; If using settings.CustomRanks set this to the custom rank name (eg. "Baristas")
		Function = function(plr,args)    -- Function to run for command
			print("HELLO WORLD FROM AN EXAMPLE COMMAND :)")
			print("Player supplied args[1] "..tostring(args[1]))
		end
	}
end


Prompt: --- Get signal instance

Response:
Signal.Get = function(eventName)
	--- Variables
	eventName = string.lower(eventName)

	--
	return GetEvent(eventName)
end


Prompt: --Apply Vehicle Weight

Response:
if mass<_Tune.Weight*weightScaling then
	--Calculate Weight Distribution
	local center = rWheel.CFrame.p:Lerp(fWheel.CFrame.p, _Tune.WeightDistribution/100)

	--Create Weight Brick
	weightB = Instance.new("Part",bike.Body)
	weightB.Name = "Weight"
	weightB.Anchored = true
	weightB.CanCollide = false
	weightB.BrickColor = BrickColor.new("Really black")
	weightB.TopSurface = Enum.SurfaceType.Smooth
	weightB.BottomSurface = Enum.SurfaceType.Smooth
	if _Tune.WBVisible or _Tune.Debug then
		weightB.Transparency = .75
	else
		weightB.Transparency = 1
	end
	weightB.Size = Vector3.new(_Tune.WeightBrickSize[1],_Tune.WeightBrickSize[2],_Tune.WeightBrickSize[3])
	weightB.CustomPhysicalProperties = PhysicalProperties.new(((_Tune.Weight*weightScaling)-mass)/(weightB.Size.x*weightB.Size.y*weightB.Size.z),0,0,0,0)
	weightB.CFrame=(bike.DriveSeat.CFrame-bike.DriveSeat.Position+center)*CFrame.new(0,_Tune.CGHeight,0)
else
	--Existing Weight Is Too Massive
	warn( "\n\t [NCT: M] Mass too high for specified weight."
		.."\n\t    Target Mass:\t"..(math.ceil(_Tune.Weight*weightScaling*100)/100)
		.."\n\t    Current Mass:\t"..(math.ceil(mass*100)/100))
end


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

Response:
local autoscaling	= true					--Estimates top speed

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

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

	{
		units			= "SPS"				,
		scaling			= 1					, -- Roblox standard
		maxSpeed		= 400				,
		spInc			= 40				, -- Increment between labelled notches
	}
}


Prompt: -- Folders to parse into databases

Response:
for _, databaseFolder in ipairs(ReplicatedStorage.Common.Databases:GetChildren()) do
	Database.ParseFolder(databaseFolder)
end


Prompt:
--------------------- TEMPLATE BLADE WEAPON ---------------------------
-- Waits for the child of the specified parent

Response:
local function WaitForChild(parent, childName)
	while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
	return parent[childName]
end

local SLASH_DAMAGE = 150
local DOWNSTAB_DAMAGE = 150
local THROWING_DAMAGE = 150
local HOLD_TO_THROW_TIME = 0.38

local Damage = 20

local MyHumanoid = nil
local MyTorso = nil
local MyCharacter = nil
local MyPlayer = nil

local Tool = script.Parent
local Handle = WaitForChild(Tool, 'Handle')

local BlowConnection
local Button1DownConnection
local Button1UpConnection

local PlayStabPunch
local PlayDownStab
local PlayThrow
local PlayThrowCharge

local IconUrl = Tool.TextureId  -- URL to the weapon knife icon asset

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

local SlashSound

local HitPlayers = {}

local LeftButtonDownTime = nil

local Attacking = false

function Blow(hit)
	if Attacking then
		BlowDamage(hit, Damage)
	end
end

function BlowDamage(hit, damage)
	local humanoid = hit.Parent:FindFirstChild('Humanoid')
	local player = PlayersService:GetPlayerFromCharacter(hit.Parent)
	if humanoid == nil then
		Handle.WallHit:Play()
		wait(0.1)
		if game.Workspace.Handle == nil then
		else
			game.Workspace.Handle:Destroy()
		end
	else
		if humanoid.Health == 0 then
		else
			Handle.Ragdoll:clone().Parent = hit.Parent
			humanoid.Health = 0
			Handle.DeadPlayer:Play()
			Handle.DeadSound:Play()
		end
		wait(0.1)
		if game.Workspace.Handle == nil then
		else
			game.Workspace.Handle:Destroy()
		end
	end
	if humanoid ~= nil and MyHumanoid ~= nil and humanoid ~= MyHumanoid then
		if not MyPlayer.Neutral then
			-- Ignore teammates hit
			if player and player ~= MyPlayer and player.TeamColor == MyPlayer.TeamColor then
				return
			end
		end
		-- final check, make sure weapon is in-hand
		local rightArm = MyCharacter:FindFirstChild('Right Arm')
		if (rightArm ~= nil) then
			-- Check if the weld exists between the hand and the weapon
			local joint = rightArm:FindFirstChild('RightGrip')
			if (joint ~= nil and (joint.Part0 == Handle or joint.Part1 == Handle)) then
				-- Make sure you only hit them once per swing
				if player and not HitPlayers[player] then
					TagHumanoid(humanoid, MyPlayer)
					print("Sending " .. damage)
					humanoid:TakeDamage(damage)
					Handle.Splat.Volume = 1
					Handle.Splat:Play()
					HitPlayers[player] = true
				end
			end
		end
	end
end
function TagHumanoid(humanoid, player)
	-- Add more tags here to customize what tags are available.
	while humanoid:FindFirstChild('creator') do
		humanoid:FindFirstChild('creator'):Destroy()
	end

	local creatorTag = Instance.new('ObjectValue')
	creatorTag.Value = player
	creatorTag.Name = 'creator'
	creatorTag.Parent = humanoid
	DebrisService:AddItem(creatorTag, 1.5)

	local weaponIconTag = Instance.new('StringValue')
	weaponIconTag.Value = IconUrl
	weaponIconTag.Name = 'icon'
	weaponIconTag.Parent = creatorTag
	DebrisService:AddItem(weaponIconTag, 1.5)
end

function HardAttack()
	Handle.Attack:Play()
	if PlayStabPunch then
		PlayStabPunch.Value = true
		wait(1.0)
		PlayStabPunch.Value = false
	end
end

function NormalAttack()
	Damage = DOWNSTAB_DAMAGE
	KnifeDown()
	Handle.Attack:Play()
	if PlayDownStab then
		PlayDownStab.Value = true
		wait(1.0)
		PlayDownStab.Value = false
	end
	KnifeUp()
end

function ThrowAttack()
	KnifeOut()
	if PlayThrow then
		PlayThrow.Value = true
		wait(0.3)
		if not Handle then return end
		local throwingHandle = Handle:Clone()
		DebrisService:AddItem(throwingHandle, 5)
		throwingHandle.Parent = Workspace
		Handle.Throw:Play()
		if MyCharacter and MyHumanoid then
			throwingHandle.Velocity = (MyHumanoid.TargetPoint - throwingHandle.CFrame.p).unit * 300
			-- set the orientation to the direction it is being thrown in
			throwingHandle.CFrame = CFrame.new(throwingHandle.CFrame.p, throwingHandle.CFrame.p + throwingHandle.Velocity) * CFrame.Angles(0, 0, math.rad(-90))
			local floatingForce = Instance.new('BodyForce', throwingHandle)
			floatingForce.force = Vector3.new(0, 196.2 * throwingHandle:GetMass() * 0.98, 0)
			local spin = Instance.new('BodyAngularVelocity', throwingHandle)
			spin.angularvelocity = throwingHandle.CFrame:vectorToWorldSpace(Vector3.new(0, -400, 0))
		end
		Handle.Transparency = 1
		-- Wait so that the knife has left the thrower's general area
		wait(0.08)
		if throwingHandle then
			local touchedConn = throwingHandle.Touched:connect(function(hit) print("hit throw") BlowDamage(hit, THROWING_DAMAGE) end)
		end
		-- must check if it still exists since we waited
		if throwingHandle then
			throwingHandle.CanCollide = true
		end
		wait(0.6)
		if Handle and PlayThrow then
			Handle.Transparency = 0
			PlayThrow.Value = false
		end
	end
	KnifeUp()
end

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

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

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

Tool.Enabled = true

function OnLeftButtonDown()
	LeftButtonDownTime = time()
end

function OnLeftButtonUp()
	if not Tool.Enabled then return end
	-- Reset the list of hit players every time we start a new attack
	HitPlayers = {}
	if PlayThrowCharge then
		PlayThrowCharge.Value = false
	end
	if Tool.Enabled and MyHumanoid and MyHumanoid.Health > 0 then
		Tool.Enabled = false
		local currTime = time()
		if LeftButtonDownTime and currTime - LeftButtonDownTime > HOLD_TO_THROW_TIME and
			currTime - LeftButtonDownTime < 1.15 then
		else
			Attacking = true
			if math.random(1, 2) == 1 then
				HardAttack()
			else
				NormalAttack()
			end
			Attacking = false
		end
		Tool.Enabled = true
	end
end

function OnRightButtonDown()
	RightButtonDownTime = time()
    if PlayThrowCharge then
		PlayThrowCharge.Value = true
	end
end

function OnRightButtonUp()
		if not Tool.Enabled then return end
	-- Reset the list of hit players every time we start a new attack
	HitPlayers = {}
	if PlayThrowCharge then
		PlayThrowCharge.Value = false
	end
	if Tool.Enabled and MyHumanoid and MyHumanoid.Health > 0 then
		Tool.Enabled = false
		local currTime = time()
		if RightButtonDownTime and currTime - RightButtonDownTime > HOLD_TO_THROW_TIME and
			currTime - RightButtonDownTime < 1.15 then
			ThrowAttack()
		else
			Attacking = true
			if math.random(1, 2) == 1 then
			else
			end
			Attacking = false
		end
		Tool.Enabled = true
	end
end

function OnEquipped(mouse)
	PlayStabPunch = WaitForChild(Tool, 'PlayStabPunch')
	PlayDownStab = WaitForChild(Tool, 'PlayDownStab')
	PlayThrow = WaitForChild(Tool, 'PlayThrow')
	PlayThrowCharge = WaitForChild(Tool, 'PlayThrowCharge')
Handle.Equip:Play()
	BlowConnection = Handle.Touched:connect(Blow)
	MyCharacter = Tool.Parent
	MyTorso = MyCharacter:FindFirstChild('Torso')
	MyHumanoid = MyCharacter:FindFirstChild('Humanoid')
	MyPlayer = PlayersService.LocalPlayer
	if mouse then
		Button1DownConnection = mouse.Button1Down:connect(OnLeftButtonDown)
		Button1UpConnection = mouse.Button1Up:connect(OnLeftButtonUp)
		Button2DownConnection = mouse.Button2Down:connect(OnRightButtonDown)
		Button2UpConnection = mouse.Button2Up:connect(OnRightButtonUp)
	end
	KnifeUp()
end

function OnUnequipped()
	-- Unequip logic here
	if BlowConnection then
		BlowConnection:disconnect()
		BlowConnection = nil
	end
	if Button1DownConnection then
		Button1DownConnection:disconnect()
		Button1DownConnection = nil
	end
	if Button1UpConnection then
		Button1UpConnection:disconnect()
		Button1UpConnection = nil
	end
	if Button2UpConnection then
		Button2UpConnection:disconnect()
		Button2UpConnection = nil
	end
	if Button2DownConnection then
		Button2DownConnection:disconnect()
		Button2DownConnection = nil
	end
	MyHumanoid = nil
end

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


Prompt:
-- waitChildren/EventFolder does not contain all the remote events, because the server version could be older than the client version.
-- In that case it would not create the new events.
-- These events are accessed directly from DefaultChatSystemChatEvents

Response:
local useEvents = {}

local FoundAllEventsEvent = Instance.new("BindableEvent")

function TryRemoveChildWithVerifyingIsCorrectType(child)
	if (waitChildren[child.Name] and child:IsA(waitChildren[child.Name])) then
		waitChildren[child.Name] = nil
		useEvents[child.Name] = child
		numChildrenRemaining = numChildrenRemaining - 1
	end
end

for i, child in pairs(EventFolder:GetChildren()) do
	TryRemoveChildWithVerifyingIsCorrectType(child)
end

if (numChildrenRemaining > 0) then
	local con = EventFolder.ChildAdded:connect(function(child)
		TryRemoveChildWithVerifyingIsCorrectType(child)
		if (numChildrenRemaining < 1) then
			FoundAllEventsEvent:Fire()
		end
	end)

	FoundAllEventsEvent.Event:wait()
	con:disconnect()

	FoundAllEventsEvent:Destroy()
end

EventFolder = useEvents


Prompt: --[[Chassis Assembly]]

Response:
		--Create Steering Axle
		local arm=Instance.new("Part",v)
		arm.Name="Arm"
		arm.Anchored=true
		arm.CanCollide=false
		arm.FormFactor=Enum.FormFactor.Custom
		arm.Size=Vector3.new(_Tune.AxleSize,_Tune.AxleSize,_Tune.AxleSize)
		arm.CFrame=(v.CFrame*CFrame.new(0,_Tune.StAxisOffset,0))*CFrame.Angles(-math.pi/2,-math.pi/2,0)
		arm.CustomPhysicalProperties = PhysicalProperties.new(_Tune.AxleDensity,0,0,0,0)
		arm.TopSurface=Enum.SurfaceType.Smooth
		arm.BottomSurface=Enum.SurfaceType.Smooth
		arm.Transparency=1

		if PGS_ON then

	--PGS Assembly---------------------------------------------------------------------------------------------------------------------------

			--Suspension Offsets
			local fAnchorOffset = Vector3.new(_Tune.FAnchorOffset[1],_Tune.FAnchorOffset[2],_Tune.FAnchorOffset[3])
			local rAnchorOffset = Vector3.new(_Tune.RAnchorOffset[1],_Tune.RAnchorOffset[2],_Tune.RAnchorOffset[3])

			--Create Wheel Suspsension Anchor
			local anchor2=arm:Clone()
			anchor2.Parent=v
			anchor2.Name="Base"
			if v.Name == "FL" or v.Name == "FR" or v.Name=="F" then
				anchor2.CFrame=anchor2.CFrame*CFrame.new(fAnchorOffset)
			else
				anchor2.CFrame=anchor2.CFrame*CFrame.new(rAnchorOffset)
			end

			--Create Body Suspsension Anchor
			local anchor1=anchor2:Clone()
			anchor1.Parent=v
			anchor1.Name="Anchor"
			if v.Name == "FL" or v.Name == "FR" or v.Name=="F" then
				anchor1.CFrame=anchor1.CFrame*CFrame.new(-_Tune.FSusLength*math.cos(math.rad(_Tune.FSusAngle)),_Tune.FSusLength*math.sin(math.rad(_Tune.FSusAngle)),0)
			else
				anchor1.CFrame=anchor1.CFrame*CFrame.new(-_Tune.RSusLength*math.cos(math.rad(_Tune.RSusAngle)),_Tune.RSusLength*math.sin(math.rad(_Tune.RSusAngle)),0)
			end

			--Create Attachments
			local s0=Instance.new("Attachment",anchor1)
			local s1=Instance.new("Attachment",anchor2)
			local p0=Instance.new("Attachment",anchor1)
			local r0=Instance.new("Attachment",car.DriveSeat)
			local h0=Instance.new("Attachment",car.DriveSeat)
			local a0=Instance.new("Attachment",anchor2)
			local a1=Instance.new("Attachment",arm)
			local a2=Instance.new("Attachment",arm)
			local a3=Instance.new("Attachment",v)
			s0.Name="S0"
			s1.Name="S1"
			p0.Name="P0"
			r0.Name="R0"
			h0.Name="H0"
			a0.Name="A0"
			a1.Name="A1"
			a2.Name="A2"
			a3.Name="A3"

			--Calculate Wishbone Anchor Point
			local rAnc0=(arm.CFrame*CFrame.new(fAnchorOffset+Vector3.new(-math.cos(math.rad(_Tune.FWsBoneAngle))*_Tune.FWsBoneLen,math.sin(math.rad(_Tune.FWsBoneAngle))*_Tune.FWsBoneLen,0))).p
			if v.Name == "RL" or v.Name == "RR" or v.Name=="R" then
				rAnc0=(arm.CFrame*CFrame.new(rAnchorOffset+Vector3.new(-math.cos(math.rad(_Tune.RWsBoneAngle))*_Tune.RWsBoneLen,math.sin(math.rad(_Tune.RWsBoneAngle))*_Tune.RWsBoneLen,0))).p
			end

			--Apply Attachment Alignment
			p0.Position=anchor1.CFrame:toObjectSpace(CFrame.new(anchor2.Position)).p
			r0.Position=car.DriveSeat.CFrame:toObjectSpace(CFrame.new(rAnc0)).p
			h0.Position=car.DriveSeat.CFrame:toObjectSpace(CFrame.new(anchor1.Position)).p
			a0.Position=anchor2.CFrame:toObjectSpace(CFrame.new(arm.Position)).p
			if v.Name == "FL" or v.Name == "FR" or v.Name=="F" then
				p0.Rotation=Vector3.new(0,0,-_Tune.FSusAngle)
				s1.Rotation=Vector3.new(0,0,-_Tune.FSusAngle)
			else
				p0.Rotation=Vector3.new(0,0,-_Tune.RSusAngle)
				s1.Rotation=Vector3.new(0,0,-_Tune.RSusAngle)
			end
			if v.Name=="FL" then
				s0.Rotation=Vector3.new(0,90+_Tune.FToe,0)
			elseif v.Name=="FR" then
				s0.Rotation=Vector3.new(0,90-_Tune.FToe,0)
			elseif v.Name=="RL" then
				s0.Rotation=Vector3.new(0,90+_Tune.RToe,0)
			elseif v.Name=="RR" then
				s0.Rotation=Vector3.new(0,90-_Tune.RToe,0)
			end
			h0.Rotation=Vector3.new(0,-90,0)
			a0.Rotation=Vector3.new(90,90,0)
			a1.Rotation=Vector3.new(90,90,0)
			a2.Rotation=Vector3.new(0,0,0)
			a3.Rotation=Vector3.new(0,0,90)
			if v.Name=="FR" or v.Name=="RR" then
				h0.Rotation=Vector3.new(0,90,0)
				a2.Rotation=Vector3.new(-180,00,0)
			end

			if v.Name == "RL" or v.Name == "RR" or v.Name=="R" then
				--Lock Rear Steering Axle
				MakeWeld(anchor2,arm)
			else
				--Create Steering Hinge
				local h2=Instance.new("HingeConstraint",v)
				h2.Attachment0=a0
				h2.Attachment1=a1
			end

			--Create Wheel Spindle
			local h3=Instance.new("HingeConstraint",v)
			h3.Attachment0=a2
			h3.Attachment1=a3

			--Apply Suspension
			if _Tune.SusEnabled then
			--Suspension Enabled
				local h1=Instance.new("HingeConstraint",v)
				h1.Attachment0=h0
				h1.Attachment1=s0

				local sus=Instance.new("SpringConstraint",v)
				sus.Attachment0=s0
				sus.Attachment1=s1
				sus.Visible=_Tune.SusVisible
				sus.Radius=_Tune.SusRadius
				sus.Thickness=_Tune.SusThickness
				sus.Color=BrickColor.new(_Tune.SusColor)
				sus.Coils=_Tune.SusCoilCount
				sus.LimitsEnabled=true
				if v.Name == "FL" or v.Name == "FR" or v.Name=="F" then
					sus.MinLength=_Tune.FSusLength-math.abs(_Tune.FSusMaxComp)
					sus.MaxLength=_Tune.FSusLength+math.abs(_Tune.FSusMaxExt)
					sus.FreeLength=_Tune.FSusLength+math.abs(_Tune.FSusMaxExt)
					sus.Damping=_Tune.FSusDamping
					sus.Stiffness=_Tune.FSusStiffness
				else
					sus.MinLength=_Tune.RSusLength-math.abs(_Tune.RSusMaxComp)
					sus.MaxLength=_Tune.RSusLength+math.abs(_Tune.RSusMaxExt)
					sus.FreeLength=_Tune.RSusLength+math.abs(_Tune.RSusMaxExt)
					sus.Damping=_Tune.RSusDamping
					sus.Stiffness=_Tune.RSusStiffness
				end

				local rod=Instance.new("RodConstraint",v)
				rod.Attachment0=r0
				rod.Attachment1=s1
				rod.Length=rod.CurrentDistance
				rod.Visible=_Tune.WsBVisible
				rod.Color=BrickColor.new(_Tune.WsColor)
				rod.Thickness=_Tune.WsThickness

				local prm=Instance.new("PrismaticConstraint",v)
				prm.Attachment0=p0
				prm.Attachment1=s1
			else
			--Suspension Disabled
				anchor1:Destroy()
				MakeWeld(car.DriveSeat,anchor2)
			end

			--Weld Miscelaneous Parts
			if v:FindFirstChild("SuspensionFixed")~=nil then
				ModelWeld(v.SuspensionFixed,anchor2)
			end
			if v:FindFirstChild("WheelFixed")~=nil then
				ModelWeld(v.WheelFixed,arm)
			end
			if v:FindFirstChild("Fixed")~=nil then
				ModelWeld(v.Fixed,arm)
			end
		else

	--Legacy Assembly---------------------------------------------------------------------------------------------------------------------------

			--Create Wheel Spindle
			local base=arm:Clone()
			base.Parent=v
			base.Name="Base"
			base.CFrame=base.CFrame*CFrame.new(0,_Tune.AxleSize,0)
			base.BottomSurface=Enum.SurfaceType.Hinge

			--Create Steering Anchor
			local axle=arm:Clone()
			axle.Parent=v
			axle.Name="Axle"
			axle.CFrame=CFrame.new(v.Position-((v.CFrame*CFrame.Angles(math.pi/2,0,0)).lookVector*((v.Size.x/2)+(axle.Size.x/2))),v.Position)*CFrame.Angles(0,math.pi,0)
			axle.BackSurface=Enum.SurfaceType.Hinge

			if v.Name=="F" or v.Name=="R" then
				local axle2=arm:Clone()
				axle2.Parent=v
				axle2.Name="Axle"
				axle2.CFrame=CFrame.new(v.Position+((v.CFrame*CFrame.Angles(math.pi/2,0,0)).lookVector*((v.Size.x/2)+(axle2.Size.x/2))),v.Position)*CFrame.Angles(0,math.pi,0)
				axle2.BackSurface=Enum.SurfaceType.Hinge
				MakeWeld(arm,axle2)
			end

			--Lock Rear Steering Axle
			if v.Name == "RL" or v.Name == "RR" or v.Name=="R" then
				MakeWeld(base,axle)
			end

			--Weld Assembly
			MakeWeld(car.DriveSeat,base)
			if v.Parent.Name == "RL" or v.Parent.Name == "RR" or v.Name=="R" then
				MakeWeld(car.DriveSeat,arm)
			end

			MakeWeld(arm,axle)

			arm:MakeJoints()
			axle:MakeJoints()

			--Weld Miscelaneous Parts
			if v:FindFirstChild("SuspensionFixed")~=nil then
				ModelWeld(v.SuspensionFixed,car.DriveSeat)
			end
			if v:FindFirstChild("WheelFixed")~=nil then
				ModelWeld(v.WheelFixed,axle)
			end
			if v:FindFirstChild("Fixed")~=nil then
				ModelWeld(v.Fixed,arm)
			end
		end
	---------------------------------------------------------------------------------------------------------------------------

		--Weld Wheel Parts
		if v:FindFirstChild("Parts")~=nil then
			ModelWeld(v.Parts,v)
		end

		--Add Steering Gyro
		if v:FindFirstChild("Steer") then
			v:FindFirstChild("Steer"):Destroy()
		end

		if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then
			local steer=Instance.new("BodyGyro",arm)
			steer.Name="Steer"
			steer.P=_Tune.SteerP
			steer.D=_Tune.SteerD
			steer.MaxTorque=Vector3.new(0,_Tune.SteerMaxTorque,0)
			steer.cframe=v.CFrame*CFrame.Angles(0,-math.pi/2,0)
		end

		--Add Stabilization Gyro
		local gyro=Instance.new("BodyGyro",v)
		gyro.Name="Stabilizer"
		gyro.MaxTorque=Vector3.new(1,0,1)
		gyro.P=0
		if v.Name=="FL" or v.Name=="FR"  or v.Name=="F" then
			gyro.D=_Tune.FGyroDamp
		else
			gyro.D=_Tune.RGyroDamp
		end

		--Add Rotational BodyMover
		local AV=Instance.new("BodyAngularVelocity",v)
		AV.Name="#AV"
		AV.angularvelocity=Vector3.new(0,0,0)
		AV.maxTorque=Vector3.new(_Tune.PBrakeForce,0,_Tune.PBrakeForce)
		AV.P=1e9
	end


Prompt:
-- Explicit dependencies are dependencies that are are explicitly listed.
-- These dependencies are available to this package and ANY dependent packages below

Response:
function PackageInfoUtils.fillExplicitPackageDependencySet(
	explicitDependencySet, packageFolder, packageInfoMap, defaultReplicationType)

	assert(type(explicitDependencySet) == "table", "Bad explicitDependencySet")
	assert(typeof(packageFolder) == "Instance", "Bad packageFolder")
	assert(type(packageInfoMap) == "table", "Bad packageInfoMap")
	assert(defaultReplicationType, "No defaultReplicationType")

	for _, item in pairs(packageFolder:GetChildren()) do
		if item:IsA("Folder") and item.Name == ScriptInfoUtils.DEPENDENCY_FOLDER_NAME then
			local packageInfoList = PackageInfoUtils.getPackageInfoListFromDependencyFolder(
				item,
				packageInfoMap,
				defaultReplicationType)

			for _, packageInfo in pairs(packageInfoList) do
				explicitDependencySet[packageInfo] = true
			end
		end
	end
end

return PackageInfoUtils


Prompt: -- New VR System Modules

Response:
local VRCamera = require(script:WaitForChild("VRCamera"))
local VRVehicleCamera = require(script:WaitForChild("VRVehicleCamera"))


Prompt: -- Class

Response:
local Portal = {}
Portal.__index = Portal

function Portal.new(humanoid, windowA, windowB, cameraModule)
	local self = setmetatable({}, Portal)

	self.Humanoid = humanoid
	self.HRP = humanoid.RootPart
	self.LastPosition = self.HRP.Position
	self.TeleportTick = tick()

	self.WindowA = windowA
	self.WindowB = windowB

	self.World = nil
	self.WorldLookupA = {}
	self.WorldLookupB = {}
	self.CharacterLookups = {}

	self.Sky = nil
	self.SkyA = nil
	self.SkyB = nil

	self.CameraModule = cameraModule
	self.LastCameraCFrame = workspace.CurrentCamera.CFrame
	self.LastCameraFocus = workspace.CurrentCamera.Focus

	RUNSERVICE:BindToRenderStep("PortalBeforeInput", Enum.RenderPriority.Input.Value - 1, function(dt)
		workspace.CurrentCamera.CFrame = self.LastCameraCFrame
		workspace.CurrentCamera.Focus = self.LastCameraFocus
	end)

	RUNSERVICE:BindToRenderStep("PortalAfterCamera", Enum.RenderPriority.Camera.Value + 1, function(dt)
		self:OnAfterCameraStep(dt)
	end)

	return self
end


Prompt: --Scripted by DermonDarble

Response:
local character = script.Parent.Parent
local humanoid = character:WaitForChild("Humanoid")
local animations = {}

for i, animation in pairs(character:WaitForChild("Animations"):GetChildren()) do
	animations[animation.Name] = humanoid:LoadAnimation(animation)
end

local state = "None"

local function Grounded()
	local ray = Ray.new(character.HumanoidRootPart.Position + Vector3.new(0, -4.3, 0), Vector3.new(0, -1, 0))
	local hit, position = game.Workspace:FindPartOnRay(ray, character)
	if hit and hit.CanCollide then
		return(true)
	else
		return(false)
	end
end

local function StopAll()
	for i, animation in pairs(animations) do
		animation:Stop()
	end
end

local function ChangeState(newState)
	if state ~= newState then
		StopAll()
		state = newState
		if animations[state] then
			animations[state]:Play()
		end
	end
end

while true do
	game:GetService("RunService").Stepped:wait()
	if humanoid.Health > 0 then
		if Grounded() then
			local speed = Vector3.new(character.HumanoidRootPart.Velocity.X, 0, character.HumanoidRootPart.Velocity.Z).magnitude
			if speed > 1 then
				ChangeState("Walk")
			else
				ChangeState("Idle")
			end
		else
			local ySpeed = character.HumanoidRootPart.Velocity.Y
			if ySpeed > 0 then
				ChangeState("Jump")
			else
				ChangeState("Fall")
			end
		end
	else
		ChangeState("Dead")
	end
end


Prompt: -- Initialize paint tool

Response:
local PaintTool = require(CoreTools:WaitForChild 'Paint')
Core.AssignHotkey('V', Core.Support.Call(Core.EquipTool, PaintTool));
Core.AddToolButton(Core.Assets.PaintIcon, 'V', PaintTool)


Prompt:
--[=[
	Returns a promise that returns a remote event
	@return Promise<RemoteEvent>
]=]

Response:
function PromiseRemoteEventMixin:PromiseRemoteEvent()
	return self._maid:GivePromise(promiseChild(self._obj, self._remoteEventName))
end

return PromiseRemoteEventMixin


Response:
local exist = true
local soundplaying
local sounds = zombie.Sounds
local sr = {
sounds.Attacking, --1
sounds.Chasing, --2
sounds.Dying, --3
sounds.Walking --4
}


Prompt:
-- BEHAVIOUR
--Controller support

Response:
coroutine.wrap(function()

	-- Create PC 'Enter Controller Mode' Icon
	runService.Heartbeat:Wait() -- This is required to prevent an infinite recursion
	local Icon = require(iconModule)
	local controllerOptionIcon = Icon.new()
		:setProperty("internalIcon", true)
		:setName("_TopbarControllerOption")
		:setOrder(100)
		:setImage(11162828670)
		:setRight()
		:setEnabled(false)
		:setTip("Controller mode")
		:setProperty("deselectWhenOtherIconSelected", false)

	-- This decides what controller widgets and displays to show based upon their connected inputs
	-- For example, if on PC with a controller, give the player the option to enable controller mode with a toggle
	-- While if using a console (no mouse, but controller) then bypass the toggle and automatically enable controller mode
	userInputService:GetPropertyChangedSignal("MouseEnabled"):Connect(IconController._determineControllerDisplay)
	userInputService.GamepadConnected:Connect(IconController._determineControllerDisplay)
	userInputService.GamepadDisconnected:Connect(IconController._determineControllerDisplay)
	IconController._determineControllerDisplay()

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

	-- Hide/show topbar when indicator action selected in controller mode
	userInputService.InputBegan:Connect(function(input,gpe)
		if not IconController.controllerModeEnabled then return end
		if input.KeyCode == Enum.KeyCode.DPadDown then
			if not guiService.SelectedObject and checkTopbarEnabledAccountingForMimic() then
				IconController.setTopbarEnabled(true,false)
			end
		elseif input.KeyCode == Enum.KeyCode.ButtonB and not IconController.disableButtonB then
			if IconController.activeButtonBCallbacks == 1 and TopbarPlusGui.Indicator.Image == "rbxassetid://5278151556" then
				IconController.activeButtonBCallbacks = 0
				guiService.SelectedObject = nil
			end
			if IconController.activeButtonBCallbacks == 0 then
				IconController._previousSelectedObject = guiService.SelectedObject
				IconController._setControllerSelectedObject(nil)
				IconController.setTopbarEnabled(false,false)
			end
		end
		input:Destroy()
	end)

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

	-- This checks if voice chat is enabled
	task.defer(function()
		local success, enabledForUser
		while true do
			success, enabledForUser = pcall(function() return voiceChatService:IsVoiceEnabledForUserIdAsync(localPlayer.UserId) end)
			if success then
				break
			end
			task.wait(1)
		end
		local function checkVoiceChatManuallyEnabled()
			if IconController.voiceChatEnabled then
				if success and enabledForUser then
					voiceChatIsEnabledForUserAndWithinExperience = true
					IconController.updateTopbar()
				end
			end
		end
		checkVoiceChatManuallyEnabled()

		--------------- FEEL FREE TO DELETE THIS IS YOU DO NOT USE VOICE CHAT WITHIN YOUR EXPERIENCE ---------------
		localPlayer.PlayerGui:WaitForChild("TopbarPlus", 999)
		task.delay(10, function()
			checkVoiceChatManuallyEnabled()
			if IconController.voiceChatEnabled == nil and success and enabledForUser and isStudio then
				--warn("⚠TopbarPlus Action Required⚠ If VoiceChat is enabled within your experience it's vital you set IconController.voiceChatEnabled to true ``require(game.ReplicatedStorage.Icon.IconController).voiceChatEnabled = true`` otherwise the BETA label will not be accounted for within your live servers. This warning will disappear after doing so. Feel free to delete this warning or to set to false if you don't have VoiceChat enabled within your experience.")
			end
		end)
		------------------------------------------------------------------------------------------------------------

	end)

	if not isStudio then
		local ownerId = game.CreatorId
		local groupService = game:GetService("GroupService")
		if game.CreatorType == Enum.CreatorType.Group then
			local success, ownerInfo = pcall(function() return groupService:GetGroupInfoAsync(game.CreatorId).Owner end)
			if success then
				ownerId = ownerInfo.Id
			end
		end
		local version = require(iconModule.VERSION)
		if localPlayer.UserId ~= ownerId then
			local marketplaceService = game:GetService("MarketplaceService")
			local success, placeInfo = pcall(function() return marketplaceService:GetProductInfo(game.PlaceId) end)
			if success and placeInfo then
				-- Required attrbute for using TopbarPlus
				-- This is not printed within stuido and to the game owner to prevent mixing with debug prints
				local gameName = placeInfo.Name
				print(("\n\n\n⚽ %s uses TopbarPlus %s\n🍍 TopbarPlus was developed by ForeverHD and the Nanoblox Team\n🚀 You can learn more and take a free copy by searching for 'TopbarPlus' on the DevForum\n\n"):format(gameName, version))
			end
		end
	end

end)()


Prompt:
-- *** PRIVATE METHODS *** --
-- Initialization

Response:
function Input:_init ()
	self:_listenForEvents ();
end


Prompt: --[[Wheel Stabilizer Gyro]]

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


Prompt: -- Basic settings

Response:
local ROTATION_SPEED = 0.1
local tweenService = game:GetService("TweenService")

while true do

	-- Wait
	local waitTime = wait()

	-- Tween to rotate
	local goal = {
		CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(0, ROTATION_SPEED, 0)
	}
	tweenService:Create(script.Parent, TweenInfo.new(waitTime, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), goal):Play()

end


Prompt: -- Split a filename into [root, dir, basename]

Response:
function Path:_splitPath(filename: string)
	filename = self:normalizeSeparators(filename)
	local root = ""
	if self:isAbsolute(filename) or self:isDriveRelative(filename) then
		root = self:getRoot(filename)
		filename = filename:sub(root:len() + 1)
	end
	local trailing_slashes = filename:match("[" .. self.sep .. "]*$")
	if trailing_slashes then
		filename = filename:sub(1, -trailing_slashes:len() - 1)
	end
	local basename = filename:match("[^" .. self.sep .. "]+$") or ""
	local dir = basename and filename:sub(1, -basename:len() - 1) or filename
	return root, dir, basename
end


Prompt: -- Main input to buffer.

Response:
function ChangeBuffer:align(diff: Diff): ()
	local s = diff[2]

	if s:match("\n") then
		local substrings = s:split("\n")
		-- ROBLOX deviation: 1-indexing
		local iLast = #substrings
		for i, substring in ipairs(substrings) do
			if i < iLast then
				-- The first substring completes the current change line.
				-- A middle substring is a change line.
				self:pushSubstring(substring)
				self:pushLine()
			elseif #substring ~= 0 then
				-- The last substring starts a change line, if it is not empty.
				-- Important: This non-empty condition also automatically omits
				-- the newline appended to the end of expected and received strings.
				self:pushSubstring(substring)
			end
		end
	else
		-- Append non-multiline string to current change line.
		self:pushDiff(diff)
	end
end


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

Response:
			},
	toollunge = {
				{ id = "http://www.roblox.com/asset/?id=129967478", weight = 10 }
			},
	wave = {
				{ id = "http://www.roblox.com/asset/?id=128777973", weight = 10 }
			},
	point = {
				{ id = "http://www.roblox.com/asset/?id=128853357", weight = 10 }
			},
	dance = {
				{ id = "http://www.roblox.com/asset/?id=182435998", weight = 10 },
				{ id = "http://www.roblox.com/asset/?id=182491037", weight = 10 },
				{ id = "http://www.roblox.com/asset/?id=182491065", weight = 10 }
			},
	dance2 = {
				{ id = "http://www.roblox.com/asset/?id=182436842", weight = 10 },
				{ id = "http://www.roblox.com/asset/?id=182491248", weight = 10 },
				{ id = "http://www.roblox.com/asset/?id=182491277", weight = 10 }
			},
	dance3 = {
				{ id = "http://www.roblox.com/asset/?id=182436935", weight = 10 },
				{ id = "http://www.roblox.com/asset/?id=182491368", weight = 10 },
				{ id = "http://www.roblox.com/asset/?id=182491423", weight = 10 }
			},
	laugh = {
				{ id = "http://www.roblox.com/asset/?id=129423131", weight = 10 }
			},
	cheer = {
				{ id = "http://www.roblox.com/asset/?id=129423030", weight = 10 }
			},
}


Prompt:
--[=[
	Destroys the RemoteSignal object.
]=]

Response:
function RemoteSignal:Destroy()
	self._re:Destroy()
	if self._signal then
		self._signal:Destroy()
	end
end


Prompt:
--F.reverseLights = function(Tog)
--	for i,v in pairs(script.Parent.Parent.Parent:getChildren()) do
--		if v:FindFirstChild('Reverse') then
--			v.Braking.Enabled = (carSeat.Ignition.Value == 1 and Tog or false)
--			v.Lights.Enabled = (carSeat.Ignition.Value == 1 and Tog or false)
--		end
--	end
--end


Prompt: -- Etc

Response:
local DESTROY_ON_DEATH = getValueFromConfig("DestroyOnDeath")
local RAGDOLL_ENABLED = getValueFromConfig("RagdollEnabled")

local DEATH_DESTROY_DELAY = 1
local PATROL_WALKSPEED = 16
local MIN_REPOSITION_TIME = 1
local MAX_REPOSITION_TIME = 5
local MAX_PARTS_PER_HEARTBEAT = 50
local ATTACK_STAND_TIME = 1
local HITBOX_SIZE = Vector3.new(5, 3, 5)
local SEARCH_DELAY = 1
local ATTACK_RANGE = 5
local ATTACK_DELAY = 1
local ATTACK_MIN_WALKSPEED = 16
local ATTACK_MAX_WALKSPEED = 36


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

Response:
local emoteNames: { [string]: boolean } =
	{ }

function configureAnimationSet(name: string, fileList: { { id: string, weight: number } })
	if animTable[name] ~= nil then
		for _, connection in ipairs(animTable[name].connections) do
			connection:Disconnect()
		end
	end

	animTable[name] = {} :: any
	animTable[name].count = 0
	animTable[name].totalWeight = 0
	animTable[name].connections = {}

	-- check for config values
	local config = script:FindFirstChild(name)
	if config ~= nil then
		--		print("Loading anims " .. name)
		table.insert(
			animTable[name].connections,
			config.ChildAdded:Connect(function(child)
				configureAnimationSet(name, fileList)
			end)
		)

		table.insert(
			animTable[name].connections,
			config.ChildRemoved:Connect(function(child)
				configureAnimationSet(name, fileList)
			end)
		)

		local idx = 1
		for _, childPart in ipairs(config:GetChildren()) do
			if childPart:IsA("Animation") then
				table.insert(
					animTable[name].connections,
					childPart.Changed:Connect(function(property)
						configureAnimationSet(name, fileList)
					end)
				)

				animTable[name][idx] = {} :: any
				animTable[name][idx].anim = childPart

				local weightObject = childPart:FindFirstChild("Weight")
				if weightObject == nil then
					animTable[name][idx].weight = 1
				else
					animTable[name][idx].weight = weightObject.Value
				end

				animTable[name].count = animTable[name].count + 1
				animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
				--			print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
				idx = idx + 1
			end
		end
	end

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


Prompt:
-- string stm_string(Stream S, int len)
-- @S - Stream object to read from
-- @len - Length of string being read

Response:
local function stm_string(S, len)
	local pos = S.index + len
	local str = string.sub(S.source, S.index, pos - 1)

	S.index = pos
	return str
end


Response:
function AI()

	if Mode == 0 then
			--waypoint = nil
			--print("Patrol mode")
			wait(math.random(5,15)/10)
			followPath(hroot.Position + Vector3.new(math.random(-MaxInc, MaxInc), 0, math.random(-MaxInc, MaxInc)))

			--human:MoveTo(zombie.Torso.Position + Vector3.new(math.random(-MaxInc, MaxInc), 0, math.random(-MaxInc, MaxInc)), CurrentPart)

	elseif Mode == 1 then

		target = findNearestTorso(hroot.Position)

		if target ~= nil then
		if CanSee == true and (hroot.Position - target.Position).Magnitude <= MinDistance then
			waypoint = nil
		else

		path:ComputeAsync(hroot.Position, target.Position)
		waypoint = path:GetWaypoints()

		local connection;
		local function checkw(t)
			local ci = 3
			if ci > #t then
				ci = 3
			end
			if t[ci] == nil and ci < #t then
				repeat ci = ci + 1 wait() until t[ci] ~= nil
				return Vector3.new(1,0,0) + t[ci]
			else
				ci = 3
				return t[ci]
			end
		end
		if path.Status == Enum.PathStatus.Success then
			--print("Chasing "..target.Parent.Name)
			human.WalkToPart = nil
		if  waypoint or checkw(waypoint) then
			if checkw(waypoint) ~= nil and checkw(waypoint).Action == Enum.PathWaypointAction.Walk then
				human:MoveTo( checkw(waypoint).Position)
			end

			if connection then
				connection:Disconnect()
			end

		else
			for i = 3, #waypoint do
				human:MoveTo( waypoint[i].Position )
			end
		end
		else
			--print("No Path,Patrolling")
			wait(math.random(5,15)/10)
			followPath(hroot.Position + Vector3.new(math.random(-MaxInc, MaxInc), 0, math.random(-MaxInc, MaxInc)))

		end
		end
		end
	elseif Mode == 2 then

		target = findNearestTorso(hroot.Position)

		if target ~= nil then
		if CanSee == true and (hroot.Position - target.Position).Magnitude <= MinDistance then
			waypoint = {}
			waypoint = nil
		else

		path:ComputeAsync(hroot.Position, target.Position)
		waypoint = path:GetWaypoints()

		local connection;
		local function checkw(t)
			local ci = 3
			if ci > #t then
				ci = 3
			end
			if t[ci] == nil and ci < #t then
				repeat ci = ci + 1 wait() until t[ci] ~= nil
				return Vector3.new(1,0,0) + t[ci]
			else
				ci = 3
				return t[ci]
			end
		end
		if path.Status == Enum.PathStatus.Success and Memory > 0 then
			--print("Chasing "..target.Parent.Name)
			human.WalkToPart = nil
			if  waypoint or checkw(waypoint) then
				if checkw(waypoint) ~= nil and checkw(waypoint).Action == Enum.PathWaypointAction.Walk then
					human:MoveTo( checkw(waypoint).Position )
				end

				if connection then
					connection:Disconnect()
				end

			else
				for i = 3, #waypoint do
					human:MoveTo( waypoint[i].Position )
				end
			end
		else
			waypoint = nil
			--print("No Path,Patrolling")
			wait(math.random(5,15)/10)
			followPath(hroot.Position + Vector3.new(math.random(-MaxInc, MaxInc), 0, math.random(-MaxInc, MaxInc)))

		end
		end
		end
	elseif Mode == 3 then
		--	print("Guarding")
	end
end


Prompt:
--[=[
	Saves all stored data.
	@return Promise
]=]

Response:
function DataStore:Save()
	if self:DidLoadFail() then
		warn("[DataStore] - Not saving, failed to load")
		return Promise.rejected("Load not successful, not saving")
	end

	if DEBUG_WRITING then
		print("[DataStore.Save] - Starting save routine")
	end

	-- Avoid constructing promises for every callback down the datastore
	-- upon save.
	return (self:_promiseInvokeSavingCallbacks() or Promise.resolved())
		:Then(function()
			if not self:HasWritableData() then
				-- Nothing to save, don't update anything
				if DEBUG_WRITING then
					print("[DataStore.Save] - Not saving, nothing staged")
				end
				return nil
			else
				return self:_saveData(self:GetNewWriter())
			end
		end)
end


Prompt:
--[[--------------------------------------------------------------------
-- Notes:
-- * some unused C code that were not converted are kept as comments
-- * LUA_COMPAT_VARARG option changed into a comment block
-- * for value/size specific code added, look for 'NOTE: '
--
-- Not implemented:
-- * luaX_newstring not needed by this Lua implementation
-- * luaG_checkcode() in assert is not currently implemented
--
-- Added:
-- * some constants added from various header files
-- * luaY.LUA_QS used in error_expected, check_match (from luaconf.h)
-- * luaY:LUA_QL needed for error messages (from luaconf.h)
-- * luaY:growvector (from lmem.h) -- skeleton only, limit checking
-- * luaY.SHRT_MAX (from <limits.h>) for registerlocalvar
-- * luaY:newproto (from lfunc.c)
-- * luaY:int2fb (from lobject.c)
-- * NOTE: HASARG_MASK, for implementing a VARARG_HASARG bit operation
-- * NOTE: value-specific code for VARARG_NEEDSARG to replace a bitop
--
-- Changed in 5.1.x:
-- * various code changes are not detailed...
-- * names of constants may have changed, e.g. added a LUAI_ prefix
-- * struct expkind: added VKNUM, VVARARG; VCALL's info changed?
-- * struct expdesc: added nval
-- * struct FuncState: upvalues data type changed to upvaldesc
-- * macro hasmultret is new
-- * function checklimit moved to parser from lexer
-- * functions anchor_token, errorlimit, checknext are new
-- * checknext is new, equivalent to 5.0.x's check, see check too
-- * luaY:next and luaY:lookahead moved to lexer
-- * break keyword no longer skipped in luaY:breakstat
-- * function new_localvarstr replaced by new_localvarliteral
-- * registerlocalvar limits local variables to SHRT_MAX
-- * create_local deleted, new_localvarliteral used instead
-- * constant LUAI_MAXUPVALUES increased to 60
-- * constants MAXPARAMS, LUA_MAXPARSERLEVEL, MAXSTACK removed
-- * function interface changed: singlevaraux, singlevar
-- * enterlevel and leavelevel uses nCcalls to track call depth
-- * added a name argument to main entry function, luaY:parser
-- * function luaY_index changed to yindex
-- * luaY:int2fb()'s table size encoding format has been changed
-- * luaY:log2() no longer needed for table constructors
-- * function code_params deleted, functionality folded in parlist
-- * vararg flags handling (is_vararg) changes; also see VARARG_*
-- * LUA_COMPATUPSYNTAX section for old-style upvalues removed
-- * repeatstat() calls chunk() instead of block()
-- * function interface changed: cond, test_then_block
-- * while statement implementation considerably simplified; MAXEXPWHILE
--   and EXTRAEXP no longer required, no limits to the complexity of a
--   while condition
-- * repeat, forbody statement implementation has major changes,
--   mostly due to new scoping behaviour of local variables
-- * OPR_MULT renamed to OPR_MUL
----------------------------------------------------------------------]]


Prompt: --if i.KeyCode == Enum.KeyCode.G then REvent:FireServer("G",true)	end

Response:
end
end)

UIS.InputEnded:connect(function(i,GP)
if not GP then

if i.KeyCode == Enum.KeyCode.H then REvent:FireServer("H",false) end

end
end)


Prompt:
--[[
	ROBLOX deviation START chalk_supportsColor: chalk.supportsColor isn't defined so we'll assume
	it supports colors unless it is explicitly set to false
]]

Response:
local FAIL = if chalk.supportsColor == nil or chalk.supportsColor == true
	then chalk.reset(chalk.inverse(chalk.bold(chalk.red(string.format(" %s ", FAIL_TEXT)))))
	else FAIL_TEXT

local PASS = if chalk.supportsColor == nil or chalk.supportsColor == true
	then chalk.reset(chalk.inverse(chalk.bold(chalk.green(string.format(" %s ", PASS_TEXT)))))
	else PASS_TEXT


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

Response:
game.Workspace.doorleft.l11.BrickColor = BrickColor.new(1013)
game.Workspace.doorleft.l23.BrickColor = BrickColor.new(1013)
game.Workspace.doorleft.l32.BrickColor = BrickColor.new(1013)
game.Workspace.doorleft.l41.BrickColor = BrickColor.new(1013)
game.Workspace.doorleft.l53.BrickColor = BrickColor.new(1013)
game.Workspace.doorleft.l62.BrickColor = BrickColor.new(1013)
game.Workspace.doorleft.l71.BrickColor = BrickColor.new(1013)

game.Workspace.doorleft.l12.BrickColor = BrickColor.new(1023)
game.Workspace.doorleft.l21.BrickColor = BrickColor.new(1023)
game.Workspace.doorleft.l33.BrickColor = BrickColor.new(1023)
game.Workspace.doorleft.l42.BrickColor = BrickColor.new(1023)
game.Workspace.doorleft.l51.BrickColor = BrickColor.new(1023)
game.Workspace.doorleft.l63.BrickColor = BrickColor.new(1023)
game.Workspace.doorleft.l72.BrickColor = BrickColor.new(1023)

game.Workspace.doorleft.l13.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l22.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l31.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l43.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l52.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l61.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l73.BrickColor = BrickColor.new(106)

game.Workspace.doorleft.pillar.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.Lighting.flashcurrent.Value = "11"


Prompt:
--[=[
	Returns the packed values from table.pack() format

	@since 3.6.0
	@return { n: number, ... T }
]=]

Response:
function Brio:GetPackedValues()
	assert(self._values, "Brio is dead")

	return self._values
end


Prompt:
--[=[
	@param msg string
	@return value: any
	Unwraps the value in the option, otherwise throws an error with `msg` as the error message.
	```lua
	local opt = Option.Some(10)
	print(opt:Expect("No number")) -> 10
	print(Option.None:Expect("No number")) -- Throws an error "No number"
	```
]=]

Response:
function Option:Expect(msg)
	assert(self:IsSome(), msg)
	return self._v
end


Prompt:
--[[

MessageCreator:DisplayFullScreenMessage(Message)
	Displays a message on the center of the screen

--]]

Response:
local MessageCreator = {}

local LogoURL = "http://www.roblox.com/asset/?id=1499731139"
local MessageHeightRelative = 0.15
local MessageDisplayTime = 3

function MessageCreator:DisplayFullScreenMessage(Message)
	local ScreenGui = Instance.new("ScreenGui")
	ScreenGui.Parent = game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui")

	local Logo = Instance.new("ImageLabel")
	Logo.SizeConstraint = "RelativeYY"
	Logo.Position = UDim2.new(0.5,0,0.5,0)
	Logo.AnchorPoint = Vector2.new(0.5,0.5)
	Logo.BackgroundTransparency = 1
	Logo.Size = UDim2.new(0,0,0,0)
	Logo.Image = LogoURL
	Logo.Parent = ScreenGui

	local TextClips = Instance.new("Frame")
	TextClips.Size = UDim2.new(0,0,MessageHeightRelative,0)
	TextClips.Position = UDim2.new(0.5,0,0.8,0)
	TextClips.AnchorPoint = Vector2.new(0.5,0)
	TextClips.BackgroundTransparency = 1
	TextClips.ClipsDescendants = true
	TextClips.Parent = Logo

	local Text = Instance.new("TextLabel")
	Text.Size = UDim2.new(14 * (0.1 / MessageHeightRelative),0,1,0)
	Text.Position = UDim2.new(0.5,0,0,0)
	Text.AnchorPoint = Vector2.new(0.5,0)
	Text.SizeConstraint = "RelativeYY"
	Text.BackgroundTransparency = 1
	Text.Font = "SourceSansBold"
	Text.TextColor3 = Color3.new(1,1,1)
	Text.TextStrokeColor3 = Color3.new(0,0,0)
	Text.TextStrokeTransparency = 0
	Text.TextScaled = true
	Text.Text = Message
	Text.Parent = TextClips

	Logo:TweenSize(UDim2.new(0.6,0,0.6,0),"InOut","Quad",0.5,true,function()
		TextClips:TweenSize(UDim2.new(1.4,0,MessageHeightRelative,0),"InOut","Quad",0.5,true,function()
			wait(MessageDisplayTime)
			TextClips:TweenSize(UDim2.new(0,0,MessageHeightRelative,0),"InOut","Quad",0.5,true,function()
				Logo:TweenSize(UDim2.new(0,0,0,0),"InOut","Quad",0.5,true,function()
					ScreenGui:Destroy()
				end)
			end)
		end)
	end)
end

return MessageCreator


Prompt: --[[Drivetrain]]

Response:
	Tune.Config			= "AWD"		--"FWD" , "RWD" , "AWD"

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

	--Traction Control Settings
	Tune.TCSEnabled		= true		-- Implements TCS
	Tune.TCSThreshold	= 10		-- Slip speed allowed before TCS starts working (in SPS)
	Tune.TCSGradient	= 20		-- Slip speed gradient between 0 to max reduction (in SPS)
	Tune.TCSLimit		= 10		-- Minimum amount of torque at max reduction (in percent)


Prompt: -- Initialize move tool

Response:
local MoveTool = require(CoreTools:WaitForChild 'Move');
Core.AssignHotkey('Z', Core.Support.Call(Core.EquipTool, MoveTool));
Core.Dock.AddToolButton(Core.Assets.MoveIcon, 'Z', MoveTool, 'MoveInfo');


Prompt: ----- Initialize -----

Response:
if IsStudio == true then
	IsLiveCheckActive = true
	coroutine.wrap(function()
		local status, message = pcall(function()
			-- This will error if current instance has no Studio API access:
			DataStoreService:GetDataStore("____PS"):SetAsync("____PS", os.time())
		end)
		local no_internet_access = status == false and string.find(message, "ConnectFail", 1, true) ~= nil
		if no_internet_access == true then
			warn("[ProfileService]: No internet access - check your network connection")
		end
		if status == false and
			(string.find(message, "403", 1, true) ~= nil or -- Cannot write to DataStore from studio if API access is not enabled
				string.find(message, "must publish", 1, true) ~= nil or -- Game must be published to access live keys
				no_internet_access == true) then -- No internet access

			UseMockDataStore = true
			ProfileService._use_mock_data_store = true
			print("[ProfileService]: Roblox API services unavailable - data will not be saved")
		else
			print("[ProfileService]: Roblox API services available - data will be saved")
		end
		IsLiveCheckActive = false
	end)()
end


Prompt: -- Sound variables

Response:
local RunSoundVol = 0.5
local RunSoundPitchLimit = 1.25


Prompt: -- This has to be done so that camera occlusion ignores the vehcile.

Response:
local function updateCameraSubject()
	local humanoid = getLocalHumanoid()
	if humanoid and humanoid.SeatPart then
		Workspace.CurrentCamera.CameraSubject = humanoid.SeatPart
	end
end
updateCameraSubject()
ProximityPromptService.Enabled = false


Prompt: -- поиск себя

Response:
function waitForChild(parent, childName)
	local child = parent:findFirstChild(childName)

	if child then
		return child
	end

	while true do
		print(childName)

		child = parent.ChildAdded:wait()

		if child.Name==childName then
			return child
		end
	end
end


Prompt:
--[[
if not service.UserInputService.KeyboardEnabled then
    warn("User is on mobile :: CustomChat Disabled")
    chatenabled = true
    drag.Visible = false
    service.StarterGui:SetCoreGuiEnabled('Chat',true)
end
--]]

Response:
	client.Handlers.RemoveCustomChat = function()
		local chat = gui
		if chat then
			chat:Destroy()
			client.Variables.ChatEnabled = true
			service.StarterGui:SetCoreGuiEnabled('Chat', true)
		end
	end

	client.Handlers.ChatHandler = function(plr, message, mode)
		if not message then
			return
		end
		if string.sub(message, 1, 2) == '/e' then
			return
		end
		if gui then
			local player

			if plr and type(plr) == "userdata" then
				player = plr
			else
				player = {
					Name = tostring(plr or "System"),
					TeamColor = BrickColor.White()
				}
			end

			if #message > 150 then
				message = `{string.sub(message, 1, 150)}...`
			end

			if mode then
				if mode == "Private" or mode == "System" then
					table.insert(storedChats, {
						Color = player.TeamColor or BrickColor.White(),
						Player = player.Name,
						Message = message,
						Mode = "Global",
						Private = true
					})
					table.insert(storedChats, {
						Color = player.TeamColor or BrickColor.White(),
						Player = player.Name,
						Message = message,
						Mode = "Team",
						Private = true
					})
					table.insert(storedChats, {
						Color = player.TeamColor or BrickColor.White(),
						Player = player.Name,
						Message = message,
						Mode = "Local",
						Private = true
					})
					table.insert(storedChats, {
						Color = player.TeamColor or BrickColor.White(),
						Player = player.Name,
						Message = message,
						Mode = "Admins",
						Private = true
					})
					table.insert(storedChats, {
						Color = player.TeamColor or BrickColor.White(),
						Player = player.Name,
						Message = message,
						Mode = "Cross",
						Private = true
					})
				else
					local plr = player.Name
					table.insert(storedChats, {
						Color = player.TeamColor or BrickColor.White(),
						Player = plr,
						Message = message,
						Mode = mode
					})
				end
			else
				local plr = player.Name
				table.insert(storedChats, {
					Color = player.TeamColor or BrickColor.White(),
					Player = plr,
					Message = message,
					Mode = "Global"
				})
			end

			if mode == "Local" then
				if not localTab.Visible then
					localb.Text = "Local*"
				end
			elseif mode == "Team" then
				if not teamTab.Visible then
					team.Text = "Team*"
				end
			elseif mode == "Admins" then
				if not adminsTab.Visible then
					admins.Text = "Admins*"
				end
			elseif mode == "Cross" then
				if not crossTab.Visible then
					cross.Text = "Cross*"
				end
			else
				if not globalTab.Visible then
					global.Text = "Global*"
				end
			end

			if #storedChats >= 50 then
				table.remove(storedChats, 1)
			end

			UpdateChat()

			if not nohide then
				if player and type(player) == "userdata" then
					local char = player.Character
					local head = char:FindFirstChild("Head")

					if head then
						local cont = service.LocalContainer():FindFirstChild(`{player.Name}Bubbles`)
						if not cont then
							cont = Instance.new("BillboardGui", service.LocalContainer())
							cont.Name = `{player.Name}Bubbles`
							cont.StudsOffset = Vector3.new(0, 2, 0)
							cont.SizeOffset = Vector2.new(0, 0.5)
							cont.Size = UDim2.new(0, 200, 0, 150)
						end

						cont.Adornee = head

						local clone = bubble:Clone()
						clone.TextLabel.Text = message
						clone.Parent = cont

						local xsize = clone.TextLabel.TextBounds.X + 40
						if xsize > 400 then
							xsize = 400
						end
						clone.Size = UDim2.new(0, xsize, 0, 50)

						if #cont:GetChildren() > 3 then
							cont:GetChildren()[1]:Destroy()
						end

						for i, v in cont:GetChildren() do
							local xsize = v.TextLabel.TextBounds.X + 40
							if xsize > 400 then
								xsize = 400
							end
							v.Position = UDim2.new(0.5, -xsize / 2, 1, -(math.abs((i - 1) - #cont:GetChildren()) * 50))
						end

						local cam = workspace.CurrentCamera
						local char = player.Character
						local head = char:FindFirstChild("Head")

						Routine(function()
							repeat
								if not head then
									break
								end
								local dist = (head.Position - cam.CFrame.p).Magnitude
								if dist <= 50 then
									clone.Visible = true
								else
									clone.Visible = false
								end
								task.wait(0.1)
							until not clone.Parent or not clone or not head or not head.Parent or not char
						end)

						task.wait(10)

						if clone then
							clone:Destroy()
						end
					end
				end
			end
		end
	end

	local textbox = service.UserInputService:GetFocusedTextBox()
	if textbox then
		textbox:ReleaseFocus()
	end
end


Prompt: --!nonstrict

Response:
local Slider = {
	Sliders = {}
}

local RunService = game:GetService("RunService")

if not RunService:IsClient() then
	error("Slider module can only be used on the Client!", 2)
	return nil
end

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

local Clamp = math.clamp
local Floor = math.floor
local Min = math.min
local Max = math.max
local Round = math.round

local Lower = string.lower
local Upper = string.upper
local Sub = string.sub
local Format = string.format

local Signal = require(script.Parent.Signal)

Slider.__index = function(object, indexed)
	local deprecated = {
		{".OnChange", ".Changed", object.Changed}
	}

	for _, tbl in ipairs(deprecated) do
		local deprecatedStr = Sub(tbl[1], 2)

		if deprecatedStr == indexed then
			warn(Format("%s is deprecated, please use %s instead", tbl[1], tbl[2]))
			return tbl[3]
		end
	end

	return Slider[indexed]
end

export type sliderConfigDictionary = {[string]: number}

function snapToScale(val, step)
	return Clamp(Floor(val / step) * step, 0, 1)
end

function lerp(start, finish, percent)
	return (1 - percent) * start + percent * finish
end

function map(value, start, stop, newStart, newEnd, constrain)
	local newVal = lerp(newStart, newEnd, getAlphaBetween(start, stop, value))
	if not constrain then
		return newVal
	end

	if newStart < newEnd then
		newStart, newEnd = newEnd, newStart
	end

	return Max(Min(newVal, newStart), newEnd)
end

function getNewPosition(self, percent)
	local absoluteSize = self._button.AbsoluteSize[self._axis]
	local holderSize = self._holder.AbsoluteSize[self._axis]

	local anchorPoint = self._button.AnchorPoint[self._axis]

	local paddingScale = (self._padding / holderSize)

	local minScale = (
		(anchorPoint * absoluteSize) / holderSize +
		paddingScale
	)

	local decrement = ((2 * absoluteSize) * anchorPoint) - absoluteSize
	local maxScale = (1 - minScale) + (decrement / holderSize)

	local newPercent = map(percent or self._percent, 0, 1, minScale, maxScale, true)

	if self._axis == "X" then
		return UDim2.new(newPercent, self._button.Position.X.Offset, self._button.Position.Y.Scale, self._button.Position.Y.Offset)
	elseif self._axis == "Y" then
		return UDim2.fromScale(self._button.Position.X.Scale, newPercent)
	end
end

function getScaleIncrement(self)
	return 1 / ((self._config.End - self._config.Start) / self._config.Increment)
end

function getAlphaBetween(a, b, c)
	return (c - a) / (b - a)
end

function getNewValue(self)
	local newValue = lerp(self._config.Start, self._config.End, self._percent)
	local incrementScale = (1 / self._config.Increment)

	newValue = Floor(newValue * incrementScale) / incrementScale
	return newValue
end

function Slider.new(holder: any, configuration: sliderConfigDictionary, moveTweenInfo: TweenInfo, axis: string, padding: number)
	assert(pcall(function()
		return holder.AbsoluteSize, holder.AbsolutePosition
	end), "Holder argument does not have an AbsoluteSize/AbsolutePosition")

	local sliderBtn = holder:FindFirstChild("Slider")
	assert(sliderBtn ~= nil, "Failed to find slider button.")
	assert(sliderBtn:IsA("GuiButton"), "Slider is not a GuiButton")

	local duplicate = false
	for _, slider in ipairs(Slider.Sliders) do
		if slider._holder == holder then
			duplicate = true
			break
		end
	end

	assert(not duplicate, "Cannot set two sliders with same frame!")
	assert(configuration.Increment ~= nil, "Failed to find Increment in configuration table")
	assert(configuration.Start ~= nil, "Failed to find Start in configuration table")
	assert(configuration.End ~= nil, "Failed to find End in configuration table")
	assert(configuration.Increment > 0, "Increment must be greater than 0")
	assert(configuration.End > configuration.Start, `Config.End must be greater than Config.Start ({configuration.End} <= {configuration.Start})`)

	axis = axis or "x"
	axis = Lower(axis)
	assert(axis == "x" or axis == "y", "Axis must be X or Y!")

	assert(typeof(moveTweenInfo) == "TweenInfo", "MoveTweenInfo must be a TweenInfo object!")

	padding = padding or 5
	assert(type(padding) == "number", "Padding variable must be a number!")

	local self = setmetatable({}, Slider)

	self._holder = holder
	self._button = sliderBtn
	self._config = configuration
	self._axis = Upper(axis)
	self._padding = padding

	self.IsHeld = false
	self._mainConnection = nil
	self._buttonConnections = {}
	self._inputPos = nil

	self._percent = 0
	if configuration.DefaultValue then
		configuration.DefaultValue = Clamp(configuration.DefaultValue, configuration.Start, configuration.End)
		self._percent = getAlphaBetween(configuration.Start, configuration.End, configuration.DefaultValue)
	end
	self._percent = Clamp(self._percent, 0, 1)

	self._value = getNewValue(self)
	self._scaleIncrement = getScaleIncrement(self)

	self._currentTween = nil
	self._tweenInfo = moveTweenInfo or TweenInfo.new(1)

	self.Changed = Signal.new()
	self.Dragged = Signal.new()
	self.Released = Signal.new()

	self:Move()
	table.insert(Slider.Sliders, self)

	return self
end

function Slider:Track()
	for _, connection in ipairs(self._buttonConnections) do
		connection:Disconnect()
	end

	table.insert(self._buttonConnections, self._button.MouseButton1Down:Connect(function()
		self.IsHeld = true
	end))

	table.insert(self._buttonConnections, self._button.MouseButton1Up:Connect(function()
		if self.IsHeld then
			self.Released:Fire(self._value)
		end
		self.IsHeld = false
	end))

	if self.Changed then
		self.Changed:Fire(self._value)
	end

	if self._mainConnection then
		self._mainConnection:Disconnect()
	end

	self._mainConnection = UserInputService.InputChanged:Connect(function(inputObject, gameProcessed)
		if inputObject.UserInputType == Enum.UserInputType.MouseMovement or inputObject.UserInputType == Enum.UserInputType.Touch then
			self._inputPos = inputObject.Position
			self:Update()
		end
	end)
end

function Slider:Update()
	if self.IsHeld and self._inputPos then
		local mousePos = self._inputPos[self._axis]

		local sliderSize = self._holder.AbsoluteSize[self._axis]
		local sliderPos = self._holder.AbsolutePosition[self._axis]
		local newPos = snapToScale((mousePos - sliderPos) / sliderSize, self._scaleIncrement)

		local percent = Clamp(newPos, 0, 1)
		self._percent = percent
		self:Move()
		self.Dragged:Fire(self._value)
	end
end

function Slider:Untrack()
	for _, connection in ipairs(self._buttonConnections) do
		connection:Disconnect()
	end
	if self._mainConnection then
		self._mainConnection:Disconnect()
	end
	self.IsHeld = false
end

function Slider:Reset()
	for _, connection in ipairs(self._buttonConnections) do
		connection:Disconnect()
	end
	if self._mainConnection then
		self._mainConnection:Disconnect()
	end

	self.IsHeld = false

	self._percent = 0
	if self._config.DefaultValue then
		self._percent = getAlphaBetween(self._config.Start, self._config.End, self._config.DefaultValue)
	end
	self._percent = Clamp(self._percent, 0, 1)
	self:Move()
end

function Slider:OverrideValue(newValue: number)
	self.IsHeld = false
	self._percent = getAlphaBetween(self._config.Start, self._config.End, newValue)
	self._percent = Clamp(self._percent, 0, 1)
	self._percent = snapToScale(self._percent, self._scaleIncrement)
	self:Move()
end

function Slider:Move()
	self._value = getNewValue(self)

	if self._currentTween then
		self._currentTween:Cancel()
	end
	self._currentTween = TweenService:Create(self._button, self._tweenInfo, {
		Position = getNewPosition(self)
	})

	self._currentTween:Play()
	self.Changed:Fire(self._value)
end

function Slider:OverrideVisualValue(newValue: number)
	if self.IsHeld then
		return false
	end

	local percent = getAlphaBetween(self._config.Start, self._config.End, newValue)
	percent = Clamp(percent, 0, 1)
	percent = snapToScale(percent, self._scaleIncrement)

	if self._currentTween then
		self._currentTween:Cancel()
	end
	self._currentTween = TweenService:Create(self._button, self._tweenInfo, {
		Position = getNewPosition(self, percent)
	})

	self._currentTween:Play()
end

function Slider:OverrideIncrement(newIncrement: number)
	self._config.Increment = newIncrement
	self._scaleIncrement = getScaleIncrement(self)
	self._percent = Clamp(self._percent, 0, 1)
	self._percent = snapToScale(self._percent, self._scaleIncrement)
	self:Move()
end

function Slider:GetValue()
	return self._value
end

function Slider:GetIncrement()
	return self._increment
end

function Slider:Destroy()
	for _, connection in ipairs(self._buttonConnections) do
		connection:Disconnect()
	end
	if self._mainConnection then
		self._mainConnection:Disconnect()
	end
	self.Changed:Destroy()
	self.Dragged:Destroy()
	self.Released:Destroy()

	for index = 1, #Slider.Sliders do
		if Slider.Sliders[index] == self then
			table.remove(Slider.Sliders, index)
		end
	end

	setmetatable(self, nil)
	self = nil
end

UserInputService.InputEnded:Connect(function(inputObject, internallyProcessed)
	if inputObject.UserInputType == Enum.UserInputType.MouseButton1 or inputObject.UserInputType == Enum.UserInputType.Touch then
		for _, slider in ipairs(Slider.Sliders) do
			if slider.IsHeld then
				slider.Released:Fire(slider._value)
			end
			slider.IsHeld = false
		end
	end
end)

return Slider


Response:
function onClicked()
R.Function1.Disabled = true

FX.ROLL.BrickColor = BrickColor.new("CGA brown")
FX.ROLL.loop.Disabled = true

FX.REVERB.BrickColor = BrickColor.new("CGA brown")
FX.REVERB.loop.Disabled = true

FX.GATE.BrickColor = BrickColor.new("CGA brown")
FX.GATE.loop.Disabled = true

FX.PHASER.BrickColor = BrickColor.new("CGA brown")
FX.PHASER.loop.Disabled = true

FX.ECHO.BrickColor = BrickColor.new("CGA brown")
FX.ECHO.loop.Disabled = true

FX.FILTER.BrickColor = BrickColor.new("CGA brown")
FX.FILTER.loop.Disabled = true

FX.SENDRETURN.BrickColor = BrickColor.new("Really red")
FX.SENDRETURN.loop.Disabled = true

FX.TRANS.BrickColor = BrickColor.new("CGA brown")
FX.TRANS.loop.Disabled = true

FX.MultiTapDelay.BrickColor = BrickColor.new("CGA brown")
FX.MultiTapDelay.loop.Disabled = true

FX.DELAY.BrickColor = BrickColor.new("CGA brown")
FX.DELAY.loop.Disabled = true

FX.REVROLL.BrickColor = BrickColor.new("CGA brown")
FX.REVROLL.loop.Disabled = true
R.loop.Disabled = false
R.Function2.Disabled = false
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)


Prompt: --[[Steering]]

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

	--Steer Gyro Tuning
	Tune.SteerD			= 1000		-- Steering Dampening
	Tune.SteerMaxTorque	= 50000		-- Steering Force
	Tune.SteerP			= 20000	    -- Steering Aggressiveness


Prompt: --Tune

Response:
local WheelieButton = "T"
local DeadZone = 70