Prompt: -- Written by Coercii

Response:
local Verifier = {}

function Verifier.typeValid(data)
	return type(data) ~= "userdata", typeof(data)
end

function Verifier.scanValidity(tbl, passed, path)
	if type(tbl) ~= "table" then
		return Verifier.scanValidity({input = tbl}, {}, {})
	end
	passed, path = passed or {}, path or {"input"}
	passed[tbl] = true
	local tblType
	do
		local key = next(tbl)
		if type(key) == "number" then
			tblType = "Array"
		else
			tblType = "Dictionary"
		end
	end
	local last = 0
	for key, value in next, tbl do
		path[#path + 1] = tostring(key)
		if type(key) == "number" then
			if tblType == "Dictionary" then
				return false, path, "Mixed Array/Dictionary"
			elseif key%1 ~= 0 then  -- if not an integer
				return false, path, "Non-integer index"
			elseif key == math.huge or key == -math.huge then
				return false, path, "(-)Infinity index"
			end
		elseif type(key) ~= "string" then
			return false, path, "Non-string key", typeof(key)
		elseif tblType == "Array" then
			return false, path, "Mixed Array/Dictionary"
		end
		if tblType == "Array" then
			if last ~= key - 1 then
				return false, path, "Array with non-sequential indexes"
			end
			last = key
		end
		local isTypeValid, valueType = Verifier.typeValid(value)
		if not isTypeValid then
			return false, path, "Invalid type", valueType
		end
		if type(value) == "table" then
			if passed[value] then
				return false, path, "Cyclic"
			end
			local isValid, keyPath, reason, extra = Verifier.scanValidity(value, passed, path)
			if not isValid then
				return isValid, keyPath, reason, extra
			end
		end
		path[#path] = nil
	end
	passed[tbl] = nil
	return true
end

function Verifier.getStringPath(path)
	return table.concat(path, ".")
end

function Verifier.testValidity(input)
	local isValid, keyPath, reason, extra = Verifier.scanValidity(input)
	if not isValid then
		if extra then
			return "Invalid at "..Verifier.getStringPath(keyPath).." because: "..reason.." ("..tostring(extra)..")"
		else
			return "Invalid at "..Verifier.getStringPath(keyPath).." because: "..reason
		end
	end
end

return Verifier


Prompt: ----- NO EDITING BELOW -----

Response:
local weldedParts = {}
table.insert(weldedParts,mainPart)

function Weld(x, y)
	weld = Instance.new("Weld")
	weld.Part0 = x
	weld.Part1 = y
	local CJ = CFrame.new(x.Position)
	weld.C0 = x.CFrame:inverse() * CJ
	weld.C1 = y.CFrame:inverse() * CJ
	weld.Parent = x
	table.insert(weldedParts,y)
end

function WeldRec(instance)
	local childs = instance:GetChildren()
	for _,v in pairs(childs) do
		if  v:IsA("BasePart") or v:IsA("MeshPart") then
			if v.Name ~= "WeldPart" and v.Name ~= "A" and v.Name ~= "B" then
				Weld(mainPart, v)
			end
		end
		if v.Name ~= "AnimationParts" then
			WeldRec(v)
		end
	end
end
wait(1)

WeldRec(P)


Prompt: --DO NOT CHANGE ANYTHING INSIDE OF THIS SCRIPT BESIDES WHAT YOU ARE TOLD TO UNLESS YOU KNOW WHAT YOU'RE DOING OR THE SCRIPT WILL NOT WORK!!

Response:
local hitPart = script.Parent
local debounce = true
local tool = game.ServerStorage.TimeToFly-- Change "Sword" to the name of your tool, make sure your tool is in ServerStorage

hitPart.Touched:Connect(function(hit)
	if debounce == true then
		if hit.Parent:FindFirstChild("Humanoid") then
			local plr = game.Players:FindFirstChild(hit.Parent.Name)
			if plr then
				debounce = false
				hitPart.BrickColor = BrickColor.new("Bright red")
				tool:Clone().Parent = plr.Backpack
				wait(3) -- Change "3" to however long you want the player to have to wait before they can get the tool again
				debounce = true
				hitPart.BrickColor = BrickColor.new("Bright green")
			end
		end
	end
end)


Prompt: --------------------------UTIL LIBRARY-------------------------------

Response:
local Utility = {}
do
	local Signal = {}

	function Signal.Create()
		local sig = {}

		local mSignaler = Instance.new('BindableEvent')

		local mArgData = nil
		local mArgDataCount = nil

		function sig:fire(...)
			mArgData = {...}
			mArgDataCount = select('#', ...)
			mSignaler:Fire()
		end

		function sig:connect(f)
			if not f then error("connect(nil)", 2) end
			return mSignaler.Event:connect(function()
				f(unpack(mArgData, 1, mArgDataCount))
			end)
		end

		function sig:wait()
			mSignaler.Event:wait()
			assert(mArgData, "Missing arg data, likely due to :TweenSize/Position corrupting threadrefs.")
			return unpack(mArgData, 1, mArgDataCount)
		end

		return sig
	end
	Utility.Signal = Signal

	function Utility.Create(instanceType)
		return function(data)
			local obj = Instance.new(instanceType)
			for k, v in pairs(data) do
				if type(k) == 'number' then
					v.Parent = obj
				else
					obj[k] = v
				end
			end
			return obj
		end
	end

	local function ViewSizeX()
		local camera = workspace.CurrentCamera
		local x = camera and camera.ViewportSize.X or 0
		local y = camera and camera.ViewportSize.Y or 0
		if x == 0 then
			return 1024
		else
			if x > y then
				return x
			else
				return y
			end
		end
	end
	Utility.ViewSizeX = ViewSizeX

	local function ViewSizeY()
		local camera = workspace.CurrentCamera
		local x = camera and camera.ViewportSize.X or 0
		local y = camera and camera.ViewportSize.Y or 0
		if y == 0 then
			return 768
		else
			if x > y then
				return y
			else
				return x
			end
		end
	end
	Utility.ViewSizeY = ViewSizeY

	local function AspectRatio()
		return ViewSizeX() / ViewSizeY()
	end
	Utility.AspectRatio = AspectRatio

	local function FindChacterAncestor(part)
		if part then
			local humanoid = part:FindFirstChild("Humanoid")
			if humanoid then
				return part, humanoid
			else
				return FindChacterAncestor(part.Parent)
			end
		end
	end
	Utility.FindChacterAncestor = FindChacterAncestor

	local function GetUnitRay(x, y, viewWidth, viewHeight, camera)
		return camera:ScreenPointToRay(x, y)
	end
	Utility.GetUnitRay = GetUnitRay

	local function Raycast(ray, ignoreNonCollidable, ignoreList)
		local ignoreList = ignoreList or {}
		local hitPart, hitPos = RayCastIgnoreList(workspace, ray, ignoreList)
		if hitPart then
			if ignoreNonCollidable and hitPart.CanCollide == false then
				table.insert(ignoreList, hitPart)
				return Raycast(ray, ignoreNonCollidable, ignoreList)
			end
			return hitPart, hitPos
		end
		return nil, nil
	end
	Utility.Raycast = Raycast

	Utility.Round = function(num, roundToNearest)
		roundToNearest = roundToNearest or 1
		return math_floor((num + roundToNearest/2) / roundToNearest) * roundToNearest
	end

	local function AveragePoints(positions)
		local avgPos = ZERO_VECTOR2
		if #positions > 0 then
			for i = 1, #positions do
				avgPos = avgPos + positions[i]
			end
			avgPos = avgPos / #positions
		end
		return avgPos
	end
	Utility.AveragePoints = AveragePoints

	local function FuzzyEquals(numa, numb)
		return numa + 0.1 > numb and numa - 0.1 < numb
	end
	Utility.FuzzyEquals = FuzzyEquals

	local LastInput = 0
	UIS.InputBegan:connect(function(inputObject, wasSunk)
		if not wasSunk then
			if inputObject.UserInputType == Enum.UserInputType.Touch or
					inputObject.UserInputType == Enum.UserInputType.MouseButton1 or
					inputObject.UserInputType == Enum.UserInputType.MouseButton2 then
				LastInput = tick()
			end
		end
	end)
	Utility.GetLastInput = function()
		return LastInput
	end
end

local humanoidCache = {}
local function findPlayerHumanoid(player)
	local character = player and player.Character
	if character then
		local resultHumanoid = humanoidCache[player]
		if resultHumanoid and resultHumanoid.Parent == character then
			return resultHumanoid
		else
			humanoidCache[player] = nil -- Bust Old Cache
			local humanoid = character:FindFirstChildOfClass("Humanoid")
			if humanoid then
				humanoidCache[player] = humanoid
			end
			return humanoid
		end
	end
end

local GetThetaBetweenCFrames; do
	local components = CFrame.new().components
	local inverse = CFrame.new().inverse
	local acos = math.acos

	GetThetaBetweenCFrames = function(c0, c1) -- (CFrame from, CFrame to) -> (float theta)
		local _, _, _, xx, yx, zx,
		               xy, yy, zy,
		               xz, yz, zz = components(inverse(c0)*c1)
		local cosTheta = (xx + yy + zz - 1)/2

		if cosTheta >= 0.999 then
			-- Same rotation
			return 0
		elseif cosTheta <= -0.999 then
			-- Oposite rotations
			return math_pi
		else
			return acos(cosTheta)
		end
	end
end


Response:
function onClicked()
R.Function1.Disabled = true
FX.CRUSH.BrickColor = BrickColor.new("Really red")
FX.CRUSH.loop.Disabled = true

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

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

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

FX.HPF.BrickColor = BrickColor.new("Really red")
FX.HPF.loop.Disabled = true
R.loop.Disabled = false
R.Function2.Disabled = false
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)


Prompt: -- constants

Response:
local PLAYER	= Players.LocalPlayer

local NUM_SLASHES		= 10
local SLASH_SIZE		= 10
local SLASH_DISTANCE	= 6
local SLASH_TIME		= 0.1

return function(character)
	local effects	= character.Effects
	local rootPart	= character.HumanoidRootPart

	for i = 1, NUM_SLASHES do
		spawn(function()
			local center	= rootPart.Position + Vector3.new(0, 1, 0)

			local slice		= script.Slice:Clone()
				slice.CFrame	= CFrame.new(center) * CFrame.Angles(math.rad(math.random(360)), math.rad(math.random(360)), math.rad(math.random(360)))
				slice.Size		= Vector3.new(0.3, 1, 1)

				slice.Mesh.Scale	= Vector3.new(1, 0, 0)
				slice.Mesh.Offset	= Vector3.new(0, 0, SLASH_DISTANCE)

				slice.Parent	= effects

			rootPart.Velocity	= slice.CFrame.LookVector * 50

			local infoA	= TweenInfo.new(SLASH_TIME/2, Enum.EasingStyle.Quad, Enum.EasingDirection.In)
			local infoB	= TweenInfo.new(SLASH_TIME/2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)

			local tweenA	= TweenService:Create(slice.Mesh, infoA, {Scale = Vector3.new(1, 1, SLASH_SIZE); Offset = Vector3.new()})
			tweenA:Play()
			wait(SLASH_TIME/2)
			local tweenB	= TweenService:Create(slice.Mesh, infoA, {Scale = Vector3.new(1, 0, 0); Offset = Vector3.new(0, 0, -SLASH_DISTANCE)})
			tweenB:Play()
			wait(SLASH_TIME/2)
			slice:Destroy()
		end)

		wait(SLASH_TIME/2)
	end
end


Prompt: -- functions

Response:
function stopAllAnimations()
	local oldAnim = currentAnim

	-- return to idle if finishing an emote
	if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
		oldAnim = "idle"
	end

	currentAnim = ""
	currentAnimInstance = nil
	if (currentAnimKeyframeHandler ~= nil) then
		currentAnimKeyframeHandler:disconnect()
	end

	if (currentAnimTrack ~= nil) then
		currentAnimTrack:Stop()
		currentAnimTrack:Destroy()
		currentAnimTrack = nil
	end
	return oldAnim
end

function setAnimationSpeed(speed)
	if speed ~= currentAnimSpeed then
		currentAnimSpeed = speed
		currentAnimTrack:AdjustSpeed(currentAnimSpeed)
	end
end

function keyFrameReachedFunc(frameName)
	if (frameName == "End") then

		local repeatAnim = currentAnim
		-- return to idle if finishing an emote
		if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
			repeatAnim = "idle"
		end

		local animSpeed = currentAnimSpeed
		playAnimation(repeatAnim, 0.0, Humanoid)
		setAnimationSpeed(animSpeed)
	end
end


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:FindFirstChild("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:
--Note this must be used with the accompanying weld script
--This is an edited version of my V3 KeyCommand Script.
--Heavily edited from a free model crouch script, ~ukwarrior6~


Prompt:
------------------------------------------------------------------------
-- emulation of TValue macros (these are from lobject.h)
-- * TValue is a table since lcode passes references around
-- * tt member field removed, using Lua's type() instead
-- * for setsvalue, sethvalue, parameter L (deleted here) in lobject.h
--   is used in an assert for testing, see checkliveness(g,obj)
------------------------------------------------------------------------

Response:
function luaK:ttisnumber(o)
  if o then return type(o.value) == "number" else return false end
end
function luaK:nvalue(o) return o.value end
function luaK:setnilvalue(o) o.value = nil end
function luaK:setsvalue(o, x) o.value = x end
luaK.setnvalue = luaK.setsvalue
luaK.sethvalue = luaK.setsvalue
luaK.setbvalue = luaK.setsvalue


Prompt:
--[[
game["Run Service"].RenderStepped:connect(function()
	local s = script.Parent.Parent.Sound
	if s and s.IsPlaying then
		local pbl = s.PlaybackLoudness
		Tool.UpdatePlaybackLoudness:FireServer(pbl)
	end
end)
]]

Response:
--

local GetPlaybackLoudness = Tool.RemoteFunction

GetPlaybackLoudness.OnClientInvoke = function()
	local s = script.Parent.Parent.Sound
	if s and s.IsPlaying then
		local pbl = s.PlaybackLoudness
		return pbl
	end
	return 0
end


Prompt: --[[Tires]]

Response:
--
	-- Tire Curve Profiler: https://www.desmos.com/calculator/og4x1gyzng
	Tune.TireCylinders	= 6			-- How many cylinders are used for the tires. More means a smoother curve but way more parts meaning lag. (Default = 4)
	Tune.TiresVisible	= false		-- Makes the tires visible (Debug)


Prompt: --[[Engine]]

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

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

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


Prompt: --end of key up function

Response:
bin.Deselected:connect(onDeselected)
bin.Selected:connect(onSelected)


Prompt: --------- MODULE BEGIN ---------

Response:
local textService = game:GetService("TextService")
local runService = game:GetService("RunService")
local animationCount = 0

function getLayerCollector(frame)
	if not frame then
		return nil
	elseif frame:IsA("LayerCollector") then
		return frame
	elseif frame and frame.Parent then
		return getLayerCollector(frame.Parent)
	else
		return nil
	end
end

function shallowCopy(tab)
	local ret = {}
	for key, value in pairs(tab) do
		ret[key] = value
	end
	return ret
end

function getColorFromString(value)
	if richText.ColorShortcuts[value] then
		 return richText.ColorShortcuts[value]
	else
		local r, g, b = value:match("(%d+),(%d+),(%d+)")
		return Color3.new(r / 255, g / 255, b / 255)
	end
end

function getVector2FromString(value)
	local x, y = value:match("(%d+),(%d+)")
	return Vector2.new(x, y)
end

function setHorizontalAlignment(frame, alignment)
	if alignment == "Left" then
		frame.AnchorPoint = Vector2.new(0, 0)
		frame.Position = UDim2.new(0, 0, 0, 0)
	elseif alignment == "Center" then
		frame.AnchorPoint = Vector2.new(0.5, 0)
		frame.Position = UDim2.new(0.5, 0, 0, 0)
	elseif alignment == "Right" then
		frame.AnchorPoint = Vector2.new(1, 0)
		frame.Position = UDim2.new(1, 0, 0, 0)
	end
end

function richText:New(frame, text, startingProperties, allowOverflow, prevTextObject)
	for _, v in pairs(frame:GetChildren()) do
		v:Destroy()
	end
	if allowOverflow == nil then
		allowOverflow = true
	end

	local properties = {}
	local defaultProperties = {}
	if prevTextObject then
		text = prevTextObject.Text
		startingProperties = prevTextObject.StartingProperties
	end

	local lineFrames = {}
	local textFrames = {}
	local frameProperties = {}
	local linePosition = 0
	local overflown = false
	local textLabel = Instance.new("TextLabel")
	local imageLabel = Instance.new("ImageLabel")
	local layerCollector = getLayerCollector(frame)

	local applyProperty, applyMarkup, formatLabel, printText, printImage, printSeries

	----- Apply properties / markups -----
	function applyMarkup(key, value)
		--print(key,value)
		key = propertyShortcuts[key] or key
		if value == "/" then
			if defaultProperties[key] then
				value = defaultProperties[key]
			else
				warn("Attempt to default <"..key.."> to value with no default")
			end
		end
		if tonumber(value) then
			value = tonumber(value)
		elseif value == "false" or value == "true" then
			value = value == "true"
		end
		properties[key] = value

		if applyProperty(key, value) then
			-- Ok
		elseif key == "ContainerHorizontalAlignment" and lineFrames[#lineFrames] then
			setHorizontalAlignment(lineFrames[#lineFrames].Container, value)
		elseif defaults[key] then
			-- Ok
		elseif key == "Img" then
			printImage(value)
		else
			-- Unknown value
			return false
		end
		return true
	end

	function applyProperty(name, value, frame)
		local propertyType
		local ret = false
		for _, label in pairs(frame and {frame} or {textLabel, imageLabel}) do
			local isProperty = pcall(function() propertyType = typeof(label[name]) end) -- is there a better way to check if it's a property?
			if isProperty then
				if propertyType == "Color3" then
					label[name] = getColorFromString(value)
				elseif propertyType == "Vector2" then
					label[name] = getVector2FromString(value)
				else
					label[name] = value
				end
				ret = true
			end
		end
		return ret
	end

	----- Set up default properties -----
	for name, value in pairs(defaults) do
		applyMarkup(name, value)
		defaultProperties[propertyShortcuts[name] or name] = properties[propertyShortcuts[name] or name]
	end
	for name, value in pairs(startingProperties or {}) do
		applyMarkup(name, value)
		defaultProperties[propertyShortcuts[name] or name] = properties[propertyShortcuts[name] or name]
	end

	if prevTextObject then
		properties = prevTextObject.OverflowPickupProperties
		for name, value in pairs(properties) do
			applyMarkup(name, value)
		end
	end

	----- Get vertical size -----
	local function getTextSize()
		if properties.TextScaled == true then
			local relativeHeight
			if properties.TextScaleRelativeTo == "Screen" then
				relativeHeight = layerCollector.AbsoluteSize.Y
			elseif properties.TextScaleRelativeTo == "Frame" then
				relativeHeight = frame.AbsoluteSize.Y
			end
			return math.min(properties.TextScale * relativeHeight, 100)
		else
			return properties.TextSize
		end
	end

	----- Lines -----
	local contentHeight = 0
	local function newLine()
		local lastLineFrame = lineFrames[#lineFrames]
		if lastLineFrame then
			contentHeight = contentHeight + lastLineFrame.Size.Y.Offset
			if not allowOverflow and contentHeight + getTextSize() > frame.AbsoluteSize.Y then
				overflown = true
				return
			end
		end
		local lineFrame = Instance.new("Frame")
		lineFrame.Name = string.format("Line%03d", #lineFrames + 1)
		lineFrame.Size = UDim2.new(0, 0, 0, 0)
		lineFrame.BackgroundTransparency = 1
		local textContainer = Instance.new("Frame", lineFrame)
		textContainer.Name = "Container"
		textContainer.Size = UDim2.new(0, 0, 0, 0)
		textContainer.BackgroundTransparency = 1
		setHorizontalAlignment(textContainer, properties.ContainerHorizontalAlignment)
		lineFrame.Parent = frame
		table.insert(lineFrames, lineFrame)
		textFrames[#lineFrames] = {}
		linePosition = 0
	end
	newLine()

	----- Label printing -----
	local function addFrameProperties(frame)
		frameProperties[frame] = shallowCopy(properties)
		frameProperties[frame].InitialSize = frame.Size
		frameProperties[frame].InitialPosition = frame.Position
		frameProperties[frame].InitialAnchorPoint = frame.AnchorPoint
	end

	function formatLabel(newLabel, labelHeight, labelWidth, endOfLineCallback)
		local lineFrame = lineFrames[#lineFrames]

		local verticalAlignment = tostring(properties.TextYAlignment)
		if verticalAlignment  == "Top" then
			newLabel.Position = UDim2.new(0, linePosition, 0, 0)
			newLabel.AnchorPoint = Vector2.new(0, 0)
		elseif verticalAlignment  == "Center" then
			newLabel.Position = UDim2.new(0, linePosition, 0.5, 0)
			newLabel.AnchorPoint = Vector2.new(0, 0.5)
		elseif verticalAlignment  == "Bottom" then
			newLabel.Position = UDim2.new(0, linePosition, 1, 0)
			newLabel.AnchorPoint = Vector2.new(0, 1)
		end

		linePosition = linePosition + labelWidth
		if linePosition > frame.AbsoluteSize.X and not (linePosition == labelWidth) then
			-- Newline, get rid of label and retry it on the next line
			newLabel:Destroy()
			local lastLabel = textFrames[#lineFrames][#textFrames[#lineFrames]]
			if lastLabel:IsA("TextLabel") and lastLabel.Text == " " then -- get rid of trailing space
				lineFrame.Container.Size = UDim2.new(0, linePosition - labelWidth - lastLabel.Size.X.Offset, 1, 0)
				lastLabel:Destroy()
				table.remove(textFrames[#lineFrames])
			end
			newLine()
			endOfLineCallback()
		else
			-- Label is ok
			newLabel.Size = UDim2.new(0, labelWidth, 0, labelHeight)
			lineFrame.Container.Size = UDim2.new(0, linePosition, 1, 0)
			lineFrame.Size = UDim2.new(1, 0, 0, math.max(lineFrame.Size.Y.Offset, labelHeight))
			newLabel.Name = string.format("Group%03d", #textFrames[#lineFrames] + 1)
			newLabel.Parent = lineFrame.Container
			table.insert(textFrames[#lineFrames], newLabel)
			addFrameProperties(newLabel)
			properties.AnimateYield = 0
		end
	end

	function printText(text)
		if text == "\n" then
			newLine()
			return
		elseif text == " " and linePosition == 0 then
			return -- no leading spaces
		end

		local textSize = getTextSize()
		local textWidth = textService:GetTextSize(text, textSize, textLabel.Font, Vector2.new(layerCollector.AbsoluteSize.X, textSize)).X

		local newTextLabel = textLabel:Clone()
		newTextLabel.TextScaled = false
		newTextLabel.TextSize = textSize
		newTextLabel.Text = text -- This text is never actually displayed. We just use it as a reference for knowing what the group string is.
		newTextLabel.TextTransparency = 1
		newTextLabel.TextStrokeTransparency = 1
		newTextLabel.TextWrapped = false

		-- Keep the real text in individual frames per character:
		local charPos = 0
		local i = 1
		for first, last in utf8.graphemes(text) do
			local character = string.sub(text, first, last)
			local characterWidth = textService:GetTextSize(character, textSize, textLabel.Font, Vector2.new(layerCollector.AbsoluteSize.X, textSize)).X
			local characterLabel = textLabel:Clone()
			characterLabel.Text = character
			characterLabel.TextScaled = false
			characterLabel.TextSize = textSize
			characterLabel.Position = UDim2.new(0, charPos, 0, 0)
			characterLabel.Size = UDim2.new(0, characterWidth + 1, 0, textSize)
			characterLabel.Name = string.format("Char%03d", i)
			characterLabel.Parent = newTextLabel
			characterLabel.Visible = false

			addFrameProperties(characterLabel)
			charPos = charPos + characterWidth
			i = i + 1
		end

		formatLabel(newTextLabel, textSize, textWidth, function() if not overflown then printText(text) end end)
	end

	function printImage(imageId)
		local imageHeight = getTextSize()
		local imageWidth = imageHeight -- Would be nice if we could get aspect ratio of image to get width properly.

		local newImageLabel = imageLabel:Clone()

		if richText.ImageShortcuts[imageId] then
			newImageLabel.Image = typeof(richText.ImageShortcuts[imageId]) == "number" and "rbxassetid://"..richText.ImageShortcuts[imageId] or richText.ImageShortcuts[imageId]
		else
			newImageLabel.Image = "rbxassetid://"..imageId
		end
		newImageLabel.Size = UDim2.new(0, imageHeight, 0, imageWidth)
		newImageLabel.Visible = false

		formatLabel(newImageLabel, imageHeight, imageWidth, function() if not overflown then printImage(imageId) end end)
	end

	function printSeries(labelSeries)
		for _, t in pairs(labelSeries) do
			local markupKey, markupValue = string.match(t, "<(.+)=(.+)>")
			if markupKey and markupValue then
				if not applyMarkup(markupKey, markupValue) then
					warn("Could not apply markup: ", t)
				end
			else
				printText(t)
			end
		end
	end

	----- Text traversal + parsing -----
	local overflowText
	local textPos = 1
	local textLength = #text
	local labelSeries = {}

	if prevTextObject then
		textPos = prevTextObject.OverflowPickupIndex
	end

	while textPos and textPos <= textLength do
		local nextMarkupStart, nextMarkupEnd = string.find(text, "<.->", textPos)
		local nextSpaceStart, nextSpaceEnd = string.find(text, "[ \t\n]", textPos)

		local nextBreakStart, nextBreakEnd, breakIsWhitespace
		if nextMarkupStart and nextMarkupEnd and (not nextSpaceStart or nextMarkupStart < nextSpaceStart) then
			nextBreakStart, nextBreakEnd = nextMarkupStart, nextMarkupEnd
		else
			nextBreakStart, nextBreakEnd = nextSpaceStart or textLength + 1, nextSpaceEnd or textLength + 1
			breakIsWhitespace = true
		end

		local nextWord = nextBreakStart > textPos and string.sub(text, textPos, nextBreakStart - 1) or nil
		local nextBreak = nextBreakStart <= textLength and string.sub(text, nextBreakStart, nextBreakEnd) or nil
		table.insert(labelSeries, nextWord)

		if breakIsWhitespace then
			printSeries(labelSeries)
			if overflown then
				break
			end
			printSeries({nextBreak})
			if overflown then
				textPos = nextBreakStart
				break
			end
			labelSeries = {}
		else
			table.insert(labelSeries, nextBreak)
		end

		textPos = nextBreakEnd + 1
		--textPos = utf8.offset(text, 2, nextBreakEnd)
	end

	if not overflown then
		printSeries(labelSeries)
	end

	----- Alignment layout -----
	local listLayout = Instance.new("UIListLayout")
	listLayout.HorizontalAlignment = properties.ContainerHorizontalAlignment
	listLayout.VerticalAlignment = properties.ContainerVerticalAlignment
	listLayout.Parent = frame

	----- Calculate content size -----
	local contentHeight = 0
	local contentLeft = frame.AbsoluteSize.X
	local contentRight = 0
	for _, lineFrame in pairs(lineFrames) do
		contentHeight = contentHeight + lineFrame.Size.Y.Offset
		local container = lineFrame.Container
		local left, right
		if container.AnchorPoint.X == 0 then
			left = container.Position.X.Offset
			right = container.Size.X.Offset
		elseif container.AnchorPoint.X == 0.5 then
			left = lineFrame.AbsoluteSize.X / 2 - container.Size.X.Offset / 2
			right = lineFrame.AbsoluteSize.X / 2 + container.Size.X.Offset / 2
		elseif container.AnchorPoint.X == 1 then
			left = lineFrame.AbsoluteSize.X - container.Size.X.Offset
			right = lineFrame.AbsoluteSize.X
		end
		contentLeft = math.min(contentLeft, left)
		contentRight = math.max(contentRight, right)
	end

	----- Animation -----
	animationCount = animationCount + 1
	local animationDone = false
	local allTextReached = false
	local overrideYield = false
	local animationRenderstepBinding = "TextAnimation"..animationCount
	local animateQueue = {}

	local function updateAnimations()
		if allTextReached and #animateQueue == 0 or animationDone then
			animationDone = true
			runService:UnbindFromRenderStep(animationRenderstepBinding)
			animateQueue = {}
			return
		end

		local t = tick()
		for i = #animateQueue, 1, -1 do
			local set = animateQueue[i]
			local properties = set.Settings
			local animateStyle = animationStyles[properties.AnimateStyle]
			if not animateStyle then
				warn("No animation style found for: ", properties.AnimateStyle, ", defaulting to Appear")
				animateStyle = animationStyles.Appear
			end
			local animateAlpha = math.min((t - set.Start) / properties.AnimateStyleTime, 1)
			animateStyle(set.Char, animateAlpha, properties)
			if animateAlpha >= 1 then
				table.remove(animateQueue, i)
			end
		end
	end

	local function setFrameToDefault(frame)
		frame.Position = frameProperties[frame].InitialPosition
		frame.Size = frameProperties[frame].InitialSize
		frame.AnchorPoint = frameProperties[frame].InitialAnchorPoint
		for name, value in pairs(frameProperties[frame]) do
			applyProperty(name, value, frame)
		end
	end

	local function setGroupVisible(frame, visible)
		frame.Visible = visible
		for _, v in pairs(frame:GetChildren()) do
			v.Visible = visible
			if visible then
				setFrameToDefault(v)
			end
		end
		if visible and frame:IsA("ImageLabel") then
			setFrameToDefault(frame)
		end
	end

	local function animate(waitForAnimationToFinish)
		animationDone = false
		runService:BindToRenderStep(animationRenderstepBinding, Enum.RenderPriority.Last.Value, updateAnimations)

		local stepGrouping
		local stepTime
		local stepFrequency
		local numAnimated

		-- Make everything invisible to start
		for lineNum, list in pairs(textFrames) do
			for _, frame in pairs(list) do
				setGroupVisible(frame, false)
			end
		end

		local function animateCharacter(char, properties)
			table.insert(animateQueue, {Char = char, Settings = properties, Start = tick()})
		end

		local function yield()
			if not overrideYield and numAnimated % stepFrequency == 0 and stepTime >= 0 then
				local yieldTime = stepTime > 0 and stepTime or nil
				wait(yieldTime)
			end
		end

		for lineNum, list in pairs(textFrames) do
			for _, frame in pairs(list) do
				local properties = frameProperties[frame]
				if not (properties.AnimateStepGrouping  == stepGrouping) or not (properties.AnimateStepFrequency == stepFrequency) then
					numAnimated = 0
				end
				stepGrouping = properties.AnimateStepGrouping
				stepTime = properties.AnimateStepTime
				stepFrequency = properties.AnimateStepFrequency

				if properties.AnimateYield > 0 then
					wait(properties.AnimateYield)
				end

				if stepGrouping == "Word" or stepGrouping == "All" then
					--if not (frame:IsA("TextLabel") and (frame.Text == " ")) then

						if frame:IsA("TextLabel") then
							frame.Visible = true

							for _, v in pairs(frame:GetChildren()) do
								animateCharacter(v, frameProperties[v])
							end
						else
							animateCharacter(frame, properties)
						end
						if stepGrouping == "Word" then
							numAnimated = numAnimated + 1
							yield()
						end
					--end
				elseif stepGrouping == "Letter" then
					if frame:IsA("TextLabel") --[[and not (frame.Text == " ") ]]then

						frame.Visible = true
						local text = frame.Text
						local i = 1
						while true do
							local sound = script.NPCSound:Clone()
						sound.Parent = game.Players.LocalPlayer.PlayerGui
						sound:Play()
						game:GetService("Debris"):AddItem(sound,.3)

							local v = frame:FindFirstChild(string.format("Char%03d", i))
							if not v then
								break
							end
							animateCharacter(v, frameProperties[v])
							numAnimated = numAnimated + 1
							yield()
							if animationDone then
								return
							end
							i = i + 1
						end
					else
						animateCharacter(frame, properties)
						numAnimated = numAnimated + 1
						yield()
					end
				else
					warn("Invalid step grouping: ", stepGrouping)
				end

				if animationDone then
					return
				end
			end
		end

		allTextReached = true

		if waitForAnimationToFinish then
			while #animateQueue > 0 do
				runService.RenderStepped:Wait()
			end
		end
	end

	local textObject = {}

	----- Overflowing -----

	textObject.Overflown = overflown
	textObject.OverflowPickupIndex = textPos
	textObject.StartingProperties = startingProperties
	textObject.OverflowPickupProperties = properties
	textObject.Text = text

	if prevTextObject then
		prevTextObject.NextTextObject = textObject
	end

	-- to overflow: check if textObject.Overflown, then use richText:ContinueOverflow(newFrame, textObject) to continue to another frame.

	----- Return object API -----

	textObject.ContentSize = Vector2.new(contentRight - contentLeft, contentHeight)

	function textObject:Animate(yield)
		if yield then
			animate()
		else
			coroutine.wrap(animate)()
		end
		if self.NextTextObject then
			self.NextTextObject:Animate(yield)
		end
	end

	function textObject:Show(finishAnimation)
		if finishAnimation then
			overrideYield = true
		else
			animationDone = true
			for lineNum, list in pairs(textFrames) do
				for _, frame in pairs(list) do
					setGroupVisible(frame, true)
				end
			end
		end
		if self.NextTextObject then
			self.NextTextObject:Show(finishAnimation)
		end
	end

	function textObject:Hide()
		animationDone = true
		for lineNum, list in pairs(textFrames) do
			for _, frame in pairs(list) do
				setGroupVisible(frame, false)
			end
		end
		if self.NextTextObject then
			self.NextTextObject:Hide()
		end
	end

	return textObject
end

function richText:ContinueOverflow(newFrame, prevTextObject)
	return richText:New(newFrame, nil, nil, false, prevTextObject)
end

return richText


Prompt: --Made by Stickmasterluke

Response:
sp = script.Parent

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

local tooltag = script:WaitForChild("ToolTag",2)

if tooltag~=nil then
	local tool=tooltag.Value
	local h=sp:FindFirstChild("Humanoid")
	if h~=nil then
		h.WalkSpeed=16+16*speedboost
		h.JumpPower=50+50*jump
		local hrp = sp:FindFirstChild("HumanoidRootPart")
		if hrp ~= nil then
			smokepart=Instance.new("Part")
			smokepart.FormFactor="Custom"
			smokepart.Size=Vector3.new(0,0,0)
			smokepart.TopSurface="Smooth"
			smokepart.BottomSurface="Smooth"
			smokepart.CanCollide=false
			smokepart.Transparency=1
			local weld=Instance.new("Weld")
			weld.Name="SmokePartWeld"
			weld.Part0 = hrp
			weld.Part1=smokepart
			weld.C0=CFrame.new(0,-3.5,0)*CFrame.Angles(math.pi/4,0,0)
			weld.Parent=smokepart
			smokepart.Parent=sp
			smoke=Instance.new("Smoke")
			smoke.Enabled = hrp.Velocity.magnitude>speedforsmoke
			smoke.RiseVelocity=2
			smoke.Opacity=0
			smoke.Size=.5
			smoke.Parent=smokepart
			h.Running:connect(function(speed)
				if smoke and smoke~=nil then
					smoke.Enabled=speed>speedforsmoke
				end
			end)
		end
	end
	while tool~=nil and tool.Parent==sp and h~=nil do
		sp.ChildRemoved:wait()
	end
	local h=sp:FindFirstChild("Humanoid")
	if h~=nil then
		h.WalkSpeed=16
		h.JumpPower=50
	end
end

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


Prompt: --Gas.InputChanged:Connect(TouchThrottle)

Response:
local function TouchBrake(input, GPE)
	if input.UserInputState == Enum.UserInputState.Begin then
		_InBrake = 1
	else
		_InBrake = 0
	end
end
Brake.InputBegan:Connect(TouchBrake)
Brake.InputEnded:Connect(TouchBrake)


Prompt: -- Game services

Response:
local Configurations = require(ServerStorage.Configurations)
local DisplayManager = require(script.Parent.DisplayManager)


Prompt: -- walking

Response:
        local FOVChanges2 = {
	        FieldOfView = 70
        }
        local TweenInformation2 = TweenInfo.new(
	        1, --tween length
	        Enum.EasingStyle.Quint, --easing Style
	        Enum.EasingDirection.Out, --easing Direction
	        0, --repitition time
	        false, --reverse?
	        0 --delay
        )

        local tween2 = TweeningService:Create(camera,TweenInformation2,FOVChanges2)


Prompt: --------------------) Settings

Response:
Damage = 0 -- the ammout of health the player or mob will take

Cooldown = 20 -- cooldown for use of the tool again

BoneModelName = "X event" -- name the zone model

HumanoidName = "Humanoid"-- the name of player or mob u want to damage


Prompt: --// Firemode Settings

Response:
	CanSelectFire = true;
	BurstEnabled = false;
	SemiEnabled = false;
	AutoEnabled = true;
	BoltAction = false;
	ExplosiveEnabled = true;


Prompt: -- Mapping side handles to axes

Response:
ArcHandles.SideToAxis = {
    Top = 'Z',
    Bottom = 'Z',
    Left = 'Y',
    Right = 'Y',
    Front = 'X',
    Back = 'X'
}
ArcHandles.AxisToSide = {
    X = 'Front',
    Y = 'Right',
    Z = 'Top'
}


Prompt: --			print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")

Response:
			idx = idx + 1
		end
	end

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


Prompt:
--[=[
	@within Shake
	@prop RotationInfluence Vector3
	This is similar to `Amplitude` but multiplies against each axis
	of the resultant shake vector, and only affects the rotation vector.

	Defaults to `Vector3.one`.
]=]


Prompt: --[[Run]]

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

	--Runtime Loop
	while wait() do
		--Steering
		Steering()

		--Powertrain
		Engine()

		--Flip
		if _Tune.AutoFlip then Flip() end

		--Update External Values
		_IsOn = script.Parent.IsOn.Value
		_InControls = script.Parent.ControlsOpen.Value
		script.Parent.Values.Gear.Value = _CGear
		script.Parent.Values.RPM.Value = _RPM
		script.Parent.Values.Horsepower.Value = _HP
		script.Parent.Values.Torque.Value = _HP * 5250 / _RPM
		script.Parent.Values.TransmissionMode.Value = _TMode
		script.Parent.Values.Throttle.Value = _GThrot
		script.Parent.Values.Brake.Value = _GBrake
		script.Parent.Values.SteerC.Value = _GSteerC*(1-math.min(car.DriveSeat.Velocity.Magnitude/_Tune.SteerDecay,1-(_Tune.MinSteer/100)))
		script.Parent.Values.SteerT.Value = _GSteerT
		script.Parent.Values.PBrake.Value = _PBrake
		script.Parent.Values.TCS.Value = _TCS
		script.Parent.Values.TCSActive.Value = _TCSActive
		script.Parent.Values.ABS.Value = _ABS
		script.Parent.Values.ABSActive.Value = _ABSActive
		script.Parent.Values.MouseSteerOn.Value = _MSteer
		script.Parent.Values.Velocity.Value = car.DriveSeat.Velocity

	end


Prompt: --- Returns a new ArgumentContext, an object that handles parsing and validating arguments

Response:
function Argument.new (command, argumentObject, value)
	local self = {
		Command = command; -- The command that owns this argument
		Type = nil; -- The type definition
		Name = argumentObject.Name; -- The name for this specific argument
		Object = argumentObject; -- The raw ArgumentObject (definition)
		Required = argumentObject.Default == nil and argumentObject.Optional ~= true; -- If the argument is required or not.
		Executor = command.Executor; -- The player who is running the command
		RawValue = value; -- The raw, unparsed value
		RawSegments = {}; -- The raw, unparsed segments (if the raw value was comma-sep)
		TransformedValues = {}; -- The transformed value (generated later)
		Prefix = ""; -- The prefix for this command (%Team)
		TextSegmentInProgress = ""; -- The text of the raw segment the user is currently typing.
		RawSegmentsAreAutocomplete = false;
	}

	if type(argumentObject.Type) == "table" then
		self.Type = argumentObject.Type
	else
		local parsedType, parsedRawValue, prefix = Util.ParsePrefixedUnionType(
			command.Cmdr.Registry:GetTypeName(argumentObject.Type),
			value
		)

		self.Type = command.Dispatcher.Registry:GetType(parsedType)
		self.RawValue = parsedRawValue
		self.Prefix = prefix

		if self.Type == nil then
			error(string.format("%s has an unregistered type %q", self.Name or "<none>", parsedType or "<none>"))
		end
	end

	setmetatable(self, Argument)

	self:Transform()

	return self
end

function Argument:GetDefaultAutocomplete()
	if self.Type.Autocomplete then
		local strings, options = self.Type.Autocomplete(self:TransformSegment(""))
		return strings, options or {}
	end

	return {}
end


Prompt:
--[[--------------------------------------------------------------------
-- Notes:
-- * an Instruction is a table with OP, A, B, C, Bx elements; this
--   makes the code easy to follow and should allow instruction handling
--   to work with doubles and ints
-- * WARNING luaP:Instruction outputs instructions encoded in little-
--   endian form and field size and positions are hard-coded
--
-- Not implemented:
-- *
--
-- Added:
-- * luaP:CREATE_Inst(c): create an inst from a number (for OP_SETLIST)
-- * luaP:Instruction(i): convert field elements to a 4-char string
-- * luaP:DecodeInst(x): convert 4-char string into field elements
--
-- Changed in 5.1.x:
-- * POS_OP added, instruction field positions changed
-- * some symbol names may have changed, e.g. LUAI_BITSINT
-- * new operators for RK indices: BITRK, ISK(x), INDEXK(r), RKASK(x)
-- * OP_MOD, OP_LEN is new
-- * OP_TEST is now OP_TESTSET, OP_TEST is new
-- * OP_FORLOOP, OP_TFORLOOP adjusted, OP_FORPREP is new
-- * OP_TFORPREP deleted
-- * OP_SETLIST and OP_SETLISTO merged and extended
-- * OP_VARARG is new
-- * many changes to implementation of OpMode data
----------------------------------------------------------------------]]

Response: local luaP = {}


Prompt: --// Modules

Response:
local L_120_ = require(L_22_:WaitForChild("Utilities"))
local L_121_ = require(L_22_:WaitForChild("Spring"))
local L_122_ = require(L_22_:WaitForChild("Plugins"))
local L_123_ = require(L_22_:WaitForChild("easing"))

local L_124_ = L_120_.Fade
local L_125_ = L_120_.SpawnCam
local L_126_ = L_120_.FixCam
local L_127_ = L_120_.tweenFoV
local L_128_ = L_120_.tweenCam
local L_129_ = L_120_.tweenRoll
local L_130_ = L_120_.TweenJoint

local L_131_ = L_120_.Weld


Prompt: -- constants

Response:
local GAME_VERSION = configuration.GAME_VERSION
local DEBUG_REPORTER = configuration.DEBUG_REPORTER
local REPORT_TO_PLAYFAB = configuration.REPORT_TO_PLAYFAB
local REPORT_TO_GOOGLE_ANALYTICS = configuration.REPORT_TO_GOOGLE_ANALYTICS
local PRINT_SUCCESSFUL_GOOGLE_ANALYTICS = configuration.PRINT_SUCCESSFUL_GOOGLE_ANALYTICS
local PRINT_SUCCESSFUL_PLAYFAB = configuration.PRINT_SUCCESSFUL_PLAYFAB


Prompt:
--[[
	DO NOT DELETE THIS LOADER
	IF YOU DO THE ADMIN WILL LOSE 78/100 OF ITS
	FEAUTURES!
-]]


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

Response:
client = nil;
cPcall = nil;
Pcall = nil;
Routine = nil;
service = nil;
GetEnv = nil;
gTable = nil;
return function(p1)
	local l__PlayerGui__1 = service.PlayerGui;
	local l__LocalPlayer__2 = service.Players.LocalPlayer;
	local l__Parent__3 = script.Parent.Parent;
	local l__Main__4 = l__Parent__3.Frame.Main;
	local l__Timer__5 = l__Parent__3.Frame.Timer;
	local v6 = p1.OnClick;
	local v7 = p1.OnClose;
	local v8 = p1.OnIgnore;
	local l__Title__9 = p1.Title;
	local v10 = p1.Message or (p1.Text or "");
	local l__Time__11 = p1.Time;
	if v6 and type(v6) == "string" then
		v6 = client.Core.LoadCode(v6, GetEnv());
	end;
	if v7 and type(v7) == "string" then
		v7 = client.Core.LoadCode(v7, GetEnv());
	end;
	if v8 and type(v8) == "string" then
		v8 = client.Core.LoadCode(v8, GetEnv());
	end;
	local v12 = client.UI.Get("NotificationHolder", nil, true);
	if not v12 then
		local v13 = service.New("ScreenGui");
		local v14 = client.UI.Register(v13);
		local v15 = service.New("ScrollingFrame", v13);
		client.UI.Prepare(v13);
		v14.Name = "NotificationHolder";
		v15.Name = "Frame";
		v15.BackgroundTransparency = 1;
		v15.Size = UDim2.new(0, 200, 0.5, 0);
		v15.Position = UDim2.new(1, -210, 0.5, -10);
		v15.CanvasSize = UDim2.new(0, 0, 0, 0);
		v15.ChildAdded:Connect(function(p2)
			if #v15:GetChildren() == 0 then
				v15.Visible = false;
				return;
			end;
			v15.Visible = true;
		end);
		v15.ChildRemoved:Connect(function(p3)
			if #v15:GetChildren() == 0 then
				v15.Visible = false;
				return;
			end;
			v15.Visible = true;
		end);
		v12 = v14;
		v14:Ready();
	end;
	l__Parent__3.Frame.Title.Text = l__Title__9;
	l__Parent__3.Name = l__Title__9;
	l__Main__4.Text = v10;
	local u1 = nil;
	local function u2(p4, p5)
		local v16 = {};
		for v17, v18 in pairs(p4:GetChildren()) do
			table.insert(v16, 1, v18);
		end;
		for v19, v20 in pairs(v16) do
			v20.Position = UDim2.new(0, 0, 1, -75 * (v19 + p5));
		end;
		p4.CanvasSize = UDim2.new(0, 0, 0, #p4:GetChildren() * 75);
		local v21 = #p4:GetChildren() * 75 - p4.AbsoluteWindowSize.Y;
		if v21 < 0 then
			v21 = 0;
		end;
		p4.CanvasPosition = Vector2.new(0, v21);
	end;
	local l__Frame__3 = v12.Object.Frame;
	l__Main__4.MouseButton1Click:Connect(function()
		if l__Parent__3 and l__Parent__3.Parent then
			if v6 then
				u1 = v6();
			end;
			l__Parent__3:Destroy();
			u2(l__Frame__3, 0);
		end;
	end);
	local l__gTable__4 = p1.gTable;
	l__Parent__3.Frame.Close.MouseButton1Click:Connect(function()
		if l__Parent__3 and l__Parent__3.Parent then
			if v7 then
				u1 = v7();
			end;
			l__gTable__4:Destroy();
			u2(l__Frame__3, 0);
		end;
	end);
	u2(l__Frame__3, 1);
	l__Parent__3.Parent = l__Frame__3;
	l__Parent__3:TweenPosition(UDim2.new(0, 0, 1, -75), "Out", "Linear", 0.2);
	spawn(function()
		local v22 = Instance.new("Sound", service.LocalContainer());
		if v10 == "Click here for commands." then
			v22.SoundId = "rbxassetid://987728667";
		elseif l__Title__9 == "Warning!" then
			v22.SoundId = "rbxassetid://428495297";
		else
			v22.SoundId = "rbxassetid://2275705078";
		end;
		wait(0.1);
		v22:Play();
		wait(1);
		v22:Destroy();
	end);
	if l__Time__11 then
		l__Timer__5.Visible = true;
		local u5 = l__Time__11;
		spawn(function()
			while true do
				l__Timer__5.Text = u5;
				wait(1);
				u5 = u5 - 1;
				if u5 <= 0 then
					break;
				end;
				if not l__Parent__3 then
					break;
				end;
				if not l__Parent__3.Parent then
					break;
				end;
			end;
			if l__Parent__3 and l__Parent__3.Parent then
				if v8 then
					u1 = v8();
				end;
				l__Parent__3:Destroy();
				u2(l__Frame__3, 0);
			end;
		end);
	end;
	while true do
		wait();
		if u1 ~= nil then
			break;
		end;
		if not l__Parent__3 then
			break;
		end;
		if not l__Parent__3.Parent then
			break;
		end;
	end;
	return nil;
end;


Prompt: -- functions

Response:
local function HandleCharacter(character)
	local player	= Players:GetPlayerFromCharacter(character)
	local playerData
	if player then
		playerData	= PLAYER_DATA:WaitForChild(player.Name)
	end

	if character then
		local humanoid	= character.Humanoid
		local armor		= humanoid.Armor
		local slots		= humanoid.ArmorSlots

		local lastSlots	= slots.Value

		armor.Changed:connect(function()
			local activeSlots	= math.ceil(armor.Value / SLOT_SIZE)
			slots.Value			= activeSlots
		end)

		slots.Changed:connect(function()
			if slots.Value > lastSlots then
				REMOTES.Effect:FireAllClients("Booster", character, "Armor")
			elseif slots.Value < lastSlots then
				REMOTES.Effect:FireAllClients("Shatter", character, "Armor")
			end

			lastSlots	= slots.Value

			-- remove old armor
			character.Armor:ClearAllChildren()

			if slots.Value > 0 then
				local armor	= CUSTOMIZATION.Armors.Default
				if playerData then
					if CUSTOMIZATION.Armors:FindFirstChild(playerData.Equipped.Armor.Value) then
						armor	= CUSTOMIZATION.Armors[playerData.Equipped.Armor.Value]
					end
				end
				local armor	= armor["Tier" .. tostring(slots.Value)]:Clone()

				local primary	= armor.PrimaryPart
				local attach	= character[primary.Name]

				for _, v in pairs(armor:GetChildren()) do
					if v:IsA("BasePart") and v ~= primary then
						v.CanCollide	= false
						v.Massless		= true

						local offset	= primary.CFrame:toObjectSpace(v.CFrame)

						local weld	= Instance.new("Weld")
							weld.Part0	= attach
							weld.Part1	= v
							weld.C0		= offset
							weld.Parent	= v

						v.Anchored	= false
					end
				end

				primary:Destroy()

				armor.Parent	= character.Armor
			end
		end)
	end
end

local function HandlePlayer(player)
	player.CharacterAdded:connect(HandleCharacter)

	HandleCharacter(player.Character)
end

local function AddArmor(character, amount)
	local armor	= character.Humanoid.Armor
	local slots	= character.Humanoid.ArmorSlots

	if armor.Value < MAX_SLOTS * SLOT_SIZE then
		slots.Value	= math.min(slots.Value + amount, MAX_SLOTS)
		armor.Value	= math.min(armor.Value + amount * SLOT_SIZE, MAX_SLOTS * SLOT_SIZE)

		return true
	end

	return false
end

local function Boost(character, amount)
	local humanoid	= character.Humanoid
	local armor		= humanoid.Armor
	local slots		= humanoid.ArmorSlots

	local maxArmor	= slots.Value * SLOT_SIZE

	armor.Value		= math.min(armor.Value + amount * SLOT_SIZE, maxArmor)
end


Prompt: --[[ Public API ]]

Response:
--
function TouchJump:Enable()
	ExternallyEnabled = true
	enableButton()
end

function TouchJump:Disable()
	ExternallyEnabled = false
	disableButton()
end

function TouchJump:Create(parentFrame)
	if JumpButton then
		JumpButton:Destroy()
		JumpButton = nil
	end

	local minAxis = math.min(parentFrame.AbsoluteSize.x, parentFrame.AbsoluteSize.y)
	local isSmallScreen = minAxis <= 500
	local jumpButtonSize = isSmallScreen and 70 or 120

	JumpButton = Instance.new('ImageButton')
	JumpButton.Name = "JumpButton"
	JumpButton.Visible = false
	JumpButton.BackgroundTransparency = 1
	JumpButton.Image = TOUCH_CONTROL_SHEET
	JumpButton.ImageRectOffset = Vector2.new(176, 222)
	JumpButton.ImageRectSize = Vector2.new(174, 174)
	JumpButton.Size = UDim2.new(0, jumpButtonSize, 0, jumpButtonSize)

    JumpButton.Position = isSmallScreen and UDim2.new(1, -(jumpButtonSize*1.5-10), 1, -jumpButtonSize - 20) or
        UDim2.new(1, -(jumpButtonSize*1.5-10), 1, -jumpButtonSize * 1.75)

	local touchObject = nil
	JumpButton.InputBegan:connect(function(inputObject)
		--A touch that starts elsewhere on the screen will be sent to a frame's InputBegan event
		--if it moves over the frame. So we check that this is actually a new touch (inputObject.UserInputState ~= Enum.UserInputState.Begin)
		if touchObject or inputObject.UserInputType ~= Enum.UserInputType.Touch
			or inputObject.UserInputState ~= Enum.UserInputState.Begin then
			return
		end

		touchObject = inputObject
		JumpButton.ImageRectOffset = Vector2.new(0, 222)
		MasterControl:SetIsJumping(true)
	end)

	OnInputEnded = function()
		touchObject = nil
		MasterControl:SetIsJumping(false)
		JumpButton.ImageRectOffset = Vector2.new(176, 222)
	end

	JumpButton.InputEnded:connect(function(inputObject)
		if inputObject == touchObject then
			OnInputEnded()
		end
	end)

	GuiService.MenuOpened:connect(function()
		if touchObject then
			OnInputEnded()
		end
	end)

	if not CharacterAddedConnection then
		setupCharacterAddedFunction()
	end

	JumpButton.Parent = parentFrame
end

return TouchJump


Prompt:
------------------------------------------------------------------------
--
-- * used in luaK:goiftrue(), luaK:goiffalse()
------------------------------------------------------------------------

Response:
function luaK:jumponcond(fs, e, cond)
  if e.k == "VRELOCABLE" then
    local ie = self:getcode(fs, e)
    if luaP:GET_OPCODE(ie) == "OP_NOT" then
      fs.pc = fs.pc - 1  -- remove previous OP_NOT
      return self:condjump(fs, "OP_TEST", luaP:GETARG_B(ie), 0, cond and 0 or 1)
    end
    -- else go through
  end
  self:discharge2anyreg(fs, e)
  self:freeexp(fs, e)
  return self:condjump(fs, "OP_TESTSET", luaP.NO_REG, e.info, cond and 1 or 0)
end


Prompt: --[[Susupension]]

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

	--Front Suspension
	Tune.FSusDamping	= 500		-- Spring Dampening
	Tune.FSusStiffness	= 9000		-- Spring Force
	Tune.FAntiRoll 		= 50		-- Anti-Roll (Gyro Dampening)

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

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

	--Rear Suspension
	Tune.RSusDamping	= 500		-- Spring Dampening
	Tune.RSusStiffness	= 9000		-- Spring Force
	Tune.RAntiRoll 		= 50		-- Anti-Roll (Gyro Dampening)

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

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

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


Prompt:
--[[
	Realistic Head Bobble Script
	Put in StarterCharacterScripts

]]


Prompt: -- Add a toolbar button named "Create Empty Script"

Response: local newScriptButton = toolbar:CreateButton("Create Empty Script", "Create an empty script", "rbxassetid://4458901886")


Prompt: --AfterHeal = Humanoid.Health + Heal

Response:
BeamTween = TAnim(BeamTweenValue, {Value = 0.3}, 0.8, "Quad", "InOut", math.huge, true, 0)

Dead = false

Died = Humanoid.Died:Connect(function()
	BeamTween:Cancel()
	Dead = true
end)

Creator.Changed:Connect(function()
	if not Creator or not Creator.Parent then
		BeamTween:Cancel()
		Dead = true
	end
end)

CreatorHumanoid.Died:Connect(function()
	BeamTween:Cancel()
	Dead = true
end)

TAnim(HealSound, {Volume = 0.3}, 0.4, "Quart", "InOut", 0, false, 0)
for i = 1, 40 do
	if Dead then
		break
	else
		Humanoid.Health = Humanoid.Health + (Heal / 30)
	end
	SWait(0.1)
end
if Died then
	Died:Disconnect()
end
HealParticle.Enabled = false
HealCross.Enabled = false
Del = TAnim(HealSound, {Volume = 0}, 0.4, "Quart", "InOut", 0, false, 0)
spawn(function()
	Del.Completed:Wait()
	HealSound:Stop()
end)
BeamTween:Cancel()
BeamTween = TAnim(BeamTweenValue, {Value = 1}, 0.5, "Quad", "InOut", 0, false, 0)
Debris:AddItem(TargetTorsoAtt, 5)
Debris:AddItem(HealBeam, 5)
Debris:AddItem(HealSound, 5)

SWait(5)
script:Destroy()


Prompt: --Script

Response:
feedbackMain.CharactersLeft.Text = maxCharacters - #feedbackMain.InputBox.Input.Text
feedbackMain.InputBox.Input.Changed:Connect(function()
	feedbackMain.CharactersLeft.Text = maxCharacters - #feedbackMain.InputBox.Input.Text
	if maxCharacters - #feedbackMain.InputBox.Input.Text < 0 then
		feedbackMain.CharactersLeft.TextColor3 = Color3.fromRGB(255,50,50)
		feedbackMain.SendButton.Style = Enum.ButtonStyle.RobloxRoundButton
	else
		feedbackMain.CharactersLeft.TextColor3 = Color3.fromRGB(255,255,255)
		feedbackMain.SendButton.Style = Enum.ButtonStyle.RobloxRoundDefaultButton
	end
end)

local db = false
feedbackMain.SendButton.MouseButton1Click:Connect(function()
	if not db and maxCharacters - #feedbackMain.InputBox.Input.Text >= 0 then
		db = true
		local msg = feedbackMain.InputBox.Input.Text
		if msg == "Type feedback/bug report here" then
			db = false
			return
		end
		feedbackMain.InputBox.Input.Text = "Sending Message..."
		local response = game.ReplicatedStorage.FilteringFunction:InvokeServer(msg)
		feedbackMain.InputBox.Input.Text = response
		wait(5)
		if feedbackMain.InputBox.Input.Text == response then
			feedbackMain.InputBox.Input.Text = "Type feedback/bug report here"
		end
		db = false
	end
end)

script.Parent.Button.MouseButton1Click:Connect(function()
	open = not open
	if open then
		feedbackMain:TweenPosition(UDim2.new(1,-300,1,-300),"Out","Quint",0.3,true)
	else
		feedbackMain:TweenPosition(UDim2.new(1,100,1,-300),"Out","Quint",0.3,true)
	end
end)


Prompt: --[[Steering]]

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


Prompt: -- Get initial data for client

Response:
getFloorMaterial()
getSoundProperties()
update()


Prompt:
--- Registers a command based purely on its definition.
-- Prefer using Registry:RegisterCommand for proper handling of server/client model.

Response:
function Registry:RegisterCommandObject (commandObject, fromCmdr)
	for key in pairs(commandObject) do
		if self.CommandMethods[key] == nil then
			error("Unknown key/method in command " .. (commandObject.Name or "unknown command") .. ": " .. key)
		end
	end

	if commandObject.Args then
		for i, arg in pairs(commandObject.Args) do
			if type(arg) == "table" then
				for key in pairs(arg) do
					if self.CommandArgProps[key] == nil then
						error(('Unknown property in command "%s" argument #%d: %s'):format(commandObject.Name or "unknown", i, key))
					end
				end
			end
		end
	end

	if commandObject.AutoExec and RunService:IsClient() then
		table.insert(self.AutoExecBuffer, commandObject.AutoExec)
		self:FlushAutoExecBufferDeferred()
	end

	-- Unregister the old command if it exists...
	local oldCommand = self.Commands[commandObject.Name:lower()]
	if oldCommand and oldCommand.Aliases then
		for _, alias in pairs(oldCommand.Aliases) do
			self.Commands[alias:lower()] = nil
		end
	elseif not oldCommand then
		table.insert(self.CommandsArray, commandObject)
	end

	self.Commands[commandObject.Name:lower()] = commandObject

	if commandObject.Aliases then
		for _, alias in pairs(commandObject.Aliases) do
			self.Commands[alias:lower()] = commandObject
		end
	end
end


Prompt:
--[=[
	Requires all the modules that are children of the given parent. This is an easy
	way to quickly load all services that might be in a folder.
	```lua
	Knit.AddServices(somewhere.Services)
	```
]=]

Response:
function KnitServer.AddServices(parent: Instance): {Service}
	local addedServices = {}
	for _,v in ipairs(parent:GetChildren()) do
		if not v:IsA("ModuleScript") then continue end
		table.insert(addedServices, require(v))
	end
	return addedServices
end


Prompt:
--[[

	CameraShakePresets.Bump
	CameraShakePresets.Explosion
	CameraShakePresets.Earthquake
	CameraShakePresets.BadTrip
	CameraShakePresets.HandheldCamera
	CameraShakePresets.Vibration
	CameraShakePresets.RoughDriving

--]]

Response:
local CameraShakeInstance = require(script.Parent.CameraShakeInstance)

local CameraShakePresets = {

	-- A high-magnitude, short, yet smooth shake.
	-- Should happen once.
	Bump = function()
		local c = CameraShakeInstance.new(2.5, 4, 0.1, 0.75)
		c.PositionInfluence = Vector3.new(0.15, 0.15, 0.15)
		c.RotationInfluence = Vector3.new(1, 1, 1)
		return c
	end;

	-- An intense and rough shake.
	-- Should happen once.
	Explosion = function()
		local c = CameraShakeInstance.new(5, 10, 0, 1.5)
		c.PositionInfluence = Vector3.new(0.25, 0.25, 0.25)
		c.RotationInfluence = Vector3.new(4, 1, 1)
		return c
	end;

	-- A continuous, rough shake
	-- Sustained.
	Earthquake = function()
		local c = CameraShakeInstance.new(0.6, 3.5, 2, 10)
		c.PositionInfluence = Vector3.new(0.25, 0.25, 0.25)
		c.RotationInfluence = Vector3.new(1, 1, 4)
		return c
	end;

	-- A bizarre shake with a very high magnitude and low roughness.
	-- Sustained.
	BadTrip = function()
		local c = CameraShakeInstance.new(10, 0.15, 5, 10)
		c.PositionInfluence = Vector3.new(0, 0, 0.15)
		c.RotationInfluence = Vector3.new(2, 1, 4)
		return c
	end;

	-- A subtle, slow shake.
	-- Sustained.
	HandheldCamera = function()
		local c = CameraShakeInstance.new(.5, 1, 4, 4)
		c.PositionInfluence = Vector3.new(2,0,0)
		c.RotationInfluence = Vector3.new(1.25,0,0)
		return c
	end;

	-- A very rough, yet low magnitude shake.
	-- Sustained.
	Vibration = function()
		local c = CameraShakeInstance.new(0.4, 20, 2, 2)
		c.PositionInfluence = Vector3.new(0, 0.15, 0)
		c.RotationInfluence = Vector3.new(1.25, 0, 4)
		return c
	end;

	-- A slightly rough, medium magnitude shake.
	-- Sustained.
	RoughDriving = function()
		local c = CameraShakeInstance.new(1, 2, 1, 1)
		c.PositionInfluence = Vector3.new(0, 0, 0)
		c.RotationInfluence = Vector3.new(1, 1, 1)
		return c
	end;

}

return setmetatable({}, {
	__index = function(t, i)
		local f = CameraShakePresets[i]
		if (type(f) == "function") then
			return f()
		end
		error("No preset found with index \"" .. i .. "\"")
	end;
})


Prompt: ----------do not edit anything below this line

Response:
local function createMessageOnClient(msg)
	game.StarterGui:SetCore("ChatMakeSystemMessage", {
		Text = msg;
		Font = Enum.Font.Arcade;
		Color = sm;
		FontSize = Enum.FontSize.Size18;
	})
end

if welcomeMessageOn then
	createMessageOnClient(welcomeMessage)
end

if displayJoinMessage then
	createMessageOnClient(game:GetService("Players").LocalPlayer.Name..joinMessage)
	game:GetService('Players').PlayerAdded:Connect(function(plr)
		createMessageOnClient(plr.Name..joinMessage)
	end)
end

if displayLeaveMessage then
	game:GetService('Players').PlayerRemoving:Connect(function(plr)
		createMessageOnClient(plr.Name..leftMessage)
	end)
end


Prompt: --Remove Existing Mass

Response:
function DReduce(p)
	for i,v in pairs(p:GetChildren())do
		if v:IsA("BasePart") then
			if v.CustomPhysicalProperties == nil then v.CustomPhysicalProperties = PhysicalProperties.new(v.Material) end
			v.CustomPhysicalProperties = PhysicalProperties.new(
				0,
				v.CustomPhysicalProperties.Friction,
				v.CustomPhysicalProperties.Elasticity,
				v.CustomPhysicalProperties.FrictionWeight,
				v.CustomPhysicalProperties.ElasticityWeight
			)
		end
		DReduce(v)
	end
end
DReduce(bike)


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

Response:
local l__VRService__1 = game:GetService("VRService");
local l__UserInputService__2 = game:GetService("UserInputService");
local l__RunService__3 = game:GetService("RunService");
local l__PathfindingService__4 = game:GetService("PathfindingService");
local l__ContextActionService__5 = game:GetService("ContextActionService");
local l__StarterGui__6 = game:GetService("StarterGui");
local l__LocalPlayer__7 = game:GetService("Players").LocalPlayer;
local v8 = Vector3.new(0, 0, 0);
local v9 = Vector3.new(1, 0, 1);
local v10 = Instance.new("BindableEvent");
v10.Name = "MovementUpdate";
v10.Parent = script;
local u1 = nil;
coroutine.wrap(function()
	local l__PathDisplay__11 = script.Parent:WaitForChild("PathDisplay");
	if l__PathDisplay__11 then
		u1 = require(l__PathDisplay__11);
	end;
end)();
local v12 = require(script.Parent:WaitForChild("BaseCharacterController"));
local v13 = setmetatable({}, v12);
v13.__index = v13;
function v13.new(p1)
	local v14 = setmetatable(v12.new(), v13);
	v14.CONTROL_ACTION_PRIORITY = p1;
	v14.navigationRequestedConn = nil;
	v14.heartbeatConn = nil;
	v14.currentDestination = nil;
	v14.currentPath = nil;
	v14.currentPoints = nil;
	v14.currentPointIdx = 0;
	v14.expectedTimeToNextPoint = 0;
	v14.timeReachedLastPoint = tick();
	v14.moving = false;
	v14.isJumpBound = false;
	v14.moveLatch = false;
	v14.userCFrameEnabledConn = nil;
	return v14;
end;
function v13.SetLaserPointerMode(p2, p3)
	pcall(function()
		l__StarterGui__6:SetCore("VRLaserPointerMode", p3);
	end);
end;
function v13.GetLocalHumanoid(p4)
	local l__Character__15 = l__LocalPlayer__7.Character;
	if not l__Character__15 then
		return;
	end;
	for v16, v17 in pairs(l__Character__15:GetChildren()) do
		if v17:IsA("Humanoid") then
			return v17;
		end;
	end;
	return nil;
end;
function v13.HasBothHandControllers(p5)
	return l__VRService__1:GetUserCFrameEnabled(Enum.UserCFrame.RightHand) and l__VRService__1:GetUserCFrameEnabled(Enum.UserCFrame.LeftHand);
end;
function v13.HasAnyHandControllers(p6)
	return l__VRService__1:GetUserCFrameEnabled(Enum.UserCFrame.RightHand) or l__VRService__1:GetUserCFrameEnabled(Enum.UserCFrame.LeftHand);
end;
function v13.IsMobileVR(p7)
	return l__UserInputService__2.TouchEnabled;
end;
function v13.HasGamepad(p8)
	return l__UserInputService__2.GamepadEnabled;
end;
function v13.ShouldUseNavigationLaser(p9)
	if p9:IsMobileVR() then
		return true;
	end;
	if p9:HasBothHandControllers() then
		return false;
	end;
	if p9:HasAnyHandControllers() then
		return true;
	end;
	return not p9:HasGamepad();
end;
function v13.StartFollowingPath(p10, p11)
	currentPath = p11;
	currentPoints = currentPath:GetPointCoordinates();
	currentPointIdx = 1;
	moving = true;
	timeReachedLastPoint = tick();
	local v18 = p10:GetLocalHumanoid();
	if v18 and v18.Torso and #currentPoints >= 1 then
		expectedTimeToNextPoint = (currentPoints[1] - v18.Torso.Position).magnitude / v18.WalkSpeed;
	end;
	v10:Fire("targetPoint", p10.currentDestination);
end;
function v13.GoToPoint(p12, p13)
	currentPath = true;
	currentPoints = { p13 };
	currentPointIdx = 1;
	moving = true;
	local v19 = p12:GetLocalHumanoid();
	timeReachedLastPoint = tick();
	expectedTimeToNextPoint = (v19.Torso.Position - p13).magnitude / v19.WalkSpeed;
	v10:Fire("targetPoint", p13);
end;
function v13.StopFollowingPath(p14)
	currentPath = nil;
	currentPoints = nil;
	currentPointIdx = 0;
	moving = false;
	p14.moveVector = v8;
end;
function v13.TryComputePath(p15, p16, p17)
	local v20 = nil;
	while not v20 and 0 < 5 do
		local v21 = l__PathfindingService__4:ComputeSmoothPathAsync(p16, p17, 200);
		if v21.Status == Enum.PathStatus.ClosestNoPath then
			return nil;
		end;
		if v21.Status == Enum.PathStatus.ClosestOutOfRange then
			return nil;
		end;
		if v21 and v21.Status == Enum.PathStatus.FailStartNotEmpty then
			p16 = p16 + (p17 - p16).Unit;
			v21 = nil;
		end;
		if v20 and v20.Status == Enum.PathStatus.FailFinishNotEmpty then
			p17 = p17 + Vector3.new(0, 1, 0);
			v20 = nil;
		end;
	end;
	return v20;
end;
function v13.OnNavigationRequest(p18, p19, p20)
	local l__Position__22 = p19.Position;
	local l__currentDestination__23 = p18.currentDestination;
	local l__x__24 = l__Position__22.x;
	local v25 = false;
	if l__x__24 == l__x__24 then
		v25 = false;
		if l__x__24 ~= (1 / 0) then
			v25 = l__x__24 ~= (-1 / 0);
		end;
	end;
	if v25 then
		local l__y__26 = l__Position__22.y;
		v25 = false;
		if l__y__26 == l__y__26 then
			v25 = false;
			if l__y__26 ~= (1 / 0) then
				v25 = l__y__26 ~= (-1 / 0);
			end;
		end;
		if v25 then
			local l__z__27 = l__Position__22.z;
			v25 = false;
			if l__z__27 == l__z__27 then
				v25 = false;
				if l__z__27 ~= (1 / 0) then
					v25 = l__z__27 ~= (-1 / 0);
				end;
			end;
		end;
	end;
	if not v25 then
		return;
	end;
	p18.currentDestination = l__Position__22;
	local v28 = p18:GetLocalHumanoid();
	if not v28 or not v28.Torso then
		return;
	end;
	local l__Position__29 = v28.Torso.Position;
	if (p18.currentDestination - l__Position__29).magnitude < 12 then
		p18:GoToPoint(p18.currentDestination);
		return;
	end;
	if not l__currentDestination__23 or (p18.currentDestination - l__currentDestination__23).magnitude > 4 then
		local v30 = p18:TryComputePath(l__Position__29, p18.currentDestination);
		if v30 then
			p18:StartFollowingPath(v30);
			if u1 then
				u1.setCurrentPoints(p18.currentPoints);
				u1.renderPath();
				return;
			end;
		else
			p18:StopFollowingPath();
			if u1 then
				u1.clearRenderedPath();
				return;
			end;
		end;
	else
		if moving then
			p18.currentPoints[#currentPoints] = p18.currentDestination;
			return;
		end;
		p18:GoToPoint(p18.currentDestination);
	end;
end;
function v13.OnJumpAction(p21, p22, p23, p24)
	if p23 == Enum.UserInputState.Begin then
		p21.isJumping = true;
	end;
	return Enum.ContextActionResult.Sink;
end;
function v13.BindJumpAction(p25, p26)
	if p26 then
		if p25.isJumpBound then
			return;
		end;
	else
		if p25.isJumpBound then
			p25.isJumpBound = false;
			l__ContextActionService__5:UnbindAction("VRJumpAction");
		end;
		return;
	end;
	p25.isJumpBound = true;
	l__ContextActionService__5:BindActionAtPriority("VRJumpAction", function()
		return p25:OnJumpAction();
	end, false, p25.CONTROL_ACTION_PRIORITY, Enum.KeyCode.ButtonA);
end;
function v13.ControlCharacterGamepad(p27, p28, p29, p30)
	if p30.KeyCode ~= Enum.KeyCode.Thumbstick1 then
		return;
	end;
	if p29 == Enum.UserInputState.Cancel then
		p27.moveVector = v8;
		return;
	end;
	if p29 ~= Enum.UserInputState.End then
		p27:StopFollowingPath();
		if u1 then
			u1.clearRenderedPath();
		end;
		if p27:ShouldUseNavigationLaser() then
			p27:BindJumpAction(true);
			p27:SetLaserPointerMode("Hidden");
		end;
		if p30.Position.magnitude > 0.22 then
			p27.moveVector = Vector3.new(p30.Position.X, 0, -p30.Position.Y);
			if p27.moveVector.magnitude > 0 then
				p27.moveVector = p27.moveVector.unit * math.min(1, p30.Position.magnitude);
			end;
			p27.moveLatch = true;
		end;
	else
		p27.moveVector = v8;
		if p27:ShouldUseNavigationLaser() then
			p27:BindJumpAction(false);
			p27:SetLaserPointerMode("Navigation");
		end;
		if p27.moveLatch then
			p27.moveLatch = false;
			v10:Fire("offtrack");
		end;
	end;
	return Enum.ContextActionResult.Sink;
end;
function v13.OnHeartbeat(p31, p32)
	local v31 = p31.moveVector;
	local v32 = p31:GetLocalHumanoid();
	if not v32 or not v32.Torso then
		return;
	end;
	if p31.moving and p31.currentPoints then
		local l__Position__33 = v32.Torso.Position;
		local v34 = (currentPoints[1] - l__Position__33) * v9;
		local l__magnitude__35 = v34.magnitude;
		local v36 = v34 / l__magnitude__35;
		if l__magnitude__35 < 1 then
			local v37 = 0;
			local v38 = currentPoints[1];
			for v39, v40 in pairs(currentPoints) do
				if v39 ~= 1 then
					v38 = v40;
					v37 = v37 + (v40 - v38).magnitude / v32.WalkSpeed;
				end;
			end;
			table.remove(currentPoints, 1);
			currentPointIdx = currentPointIdx + 1;
			if #currentPoints == 0 then
				p31:StopFollowingPath();
				if u1 then
					u1.clearRenderedPath();
				end;
				return;
			end;
			if u1 then
				u1.setCurrentPoints(currentPoints);
				u1.renderPath();
			end;
			expectedTimeToNextPoint = (currentPoints[1] - l__Position__33).magnitude / v32.WalkSpeed;
			timeReachedLastPoint = tick();
		else
			local v41 = { game.Players.LocalPlayer.Character, workspace.CurrentCamera };
			local v42, v43, v44 = workspace:FindPartOnRayWithIgnoreList(Ray.new(l__Position__33 - Vector3.new(0, 1, 0), v36 * 3), v41);
			if v42 then
				local v45 = Vector3.new(0, 100, 0);
				local v46, v47, v48 = workspace:FindPartOnRayWithIgnoreList(Ray.new(v43 + v36 * 0.5 + v45, -v45), v41);
				local v49 = v47.Y - l__Position__33.Y;
				if v49 < 6 and v49 > -2 then
					v32.Jump = true;
				end;
			end;
			if expectedTimeToNextPoint + 2 < tick() - timeReachedLastPoint then
				p31:StopFollowingPath();
				if u1 then
					u1.clearRenderedPath();
				end;
				v10:Fire("offtrack");
			end;
			v31 = p31.moveVector:Lerp(v36, p32 * 10);
		end;
	end;
	local l__x__50 = v31.x;
	local v51 = false;
	if l__x__50 == l__x__50 then
		v51 = false;
		if l__x__50 ~= (1 / 0) then
			v51 = l__x__50 ~= (-1 / 0);
		end;
	end;
	if v51 then
		local l__y__52 = v31.y;
		v51 = false;
		if l__y__52 == l__y__52 then
			v51 = false;
			if l__y__52 ~= (1 / 0) then
				v51 = l__y__52 ~= (-1 / 0);
			end;
		end;
		if v51 then
			local l__z__53 = v31.z;
			v51 = false;
			if l__z__53 == l__z__53 then
				v51 = false;
				if l__z__53 ~= (1 / 0) then
					v51 = l__z__53 ~= (-1 / 0);
				end;
			end;
		end;
	end;
	if v51 then
		p31.moveVector = v31;
	end;
end;
function v13.OnUserCFrameEnabled(p33)
	if p33:ShouldUseNavigationLaser() then
		p33:BindJumpAction(false);
		p33:SetLaserPointerMode("Navigation");
		return;
	end;
	p33:BindJumpAction(true);
	p33:SetLaserPointerMode("Hidden");
end;
function v13.Enable(p34, p35)
	p34.moveVector = v8;
	p34.isJumping = false;
	if p35 then
		p34.navigationRequestedConn = l__VRService__1.NavigationRequested:Connect(function(p36, p37)
			p34:OnNavigationRequest(p36, p37);
		end);
		p34.heartbeatConn = l__RunService__3.Heartbeat:Connect(function(p38)
			p34:OnHeartbeat(p38);
		end);
		l__ContextActionService__5:BindAction("MoveThumbstick", function(p39, p40, p41)
			return p34:ControlCharacterGamepad(p39, p40, p41);
		end, false, p34.CONTROL_ACTION_PRIORITY, Enum.KeyCode.Thumbstick1);
		l__ContextActionService__5:BindActivate(Enum.UserInputType.Gamepad1, Enum.KeyCode.ButtonR2);
		p34.userCFrameEnabledConn = l__VRService__1.UserCFrameEnabled:Connect(function()
			p34:OnUserCFrameEnabled();
		end);
		p34:OnUserCFrameEnabled();
		l__VRService__1:SetTouchpadMode(Enum.VRTouchpad.Left, Enum.VRTouchpadMode.VirtualThumbstick);
		l__VRService__1:SetTouchpadMode(Enum.VRTouchpad.Right, Enum.VRTouchpadMode.ABXY);
		p34.enabled = true;
		return;
	end;
	p34:StopFollowingPath();
	l__ContextActionService__5:UnbindAction("MoveThumbstick");
	l__ContextActionService__5:UnbindActivate(Enum.UserInputType.Gamepad1, Enum.KeyCode.ButtonR2);
	p34:BindJumpAction(false);
	p34:SetLaserPointerMode("Disabled");
	if p34.navigationRequestedConn then
		p34.navigationRequestedConn:Disconnect();
		p34.navigationRequestedConn = nil;
	end;
	if p34.heartbeatConn then
		p34.heartbeatConn:Disconnect();
		p34.heartbeatConn = nil;
	end;
	if p34.userCFrameEnabledConn then
		p34.userCFrameEnabledConn:Disconnect();
		p34.userCFrameEnabledConn = nil;
	end;
	p34.enabled = false;
end;
return v13;


Prompt:
-- Global matchers object holds the list of available matchers and
-- the state, that can hold matcher specific values that change over time.

Response: local JEST_MATCHERS_OBJECT = Symbol.for_("$$jest-matchers-object")


Prompt: -- Adjust the movement of the firefly, allowing them to roam around.

Response:
local Fly = script.Parent

while true do -- Alter the flies movement direction every once a while to make it roam around
	Fly.BodyVelocity.velocity = Vector3.new(math.random(-20,20)*0.1,math.random(-20,20)*0.1,math.random(-20,20)*0.1)
	wait(math.random(10,25)*0.1)
end


Prompt: --BaseRay.Transparency = 1

Response:
BaseRayMesh = Instance.new("SpecialMesh")
BaseRayMesh.Name = "Mesh"
BaseRayMesh.MeshType = Enum.MeshType.Brick
BaseRayMesh.Scale = Vector3.new(0.2, 0.2, 1)
BaseRayMesh.Offset = Vector3.new(0, 0.2, 0)
BaseRayMesh.VertexColor = Vector3.new(1, 1, 1)
BaseRayMesh.Parent = BaseRay

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

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

Light.Enabled = false
Tool.Enabled = true

function RayTouched(Hit, Position)
	if not Hit or not Hit.Parent then
		return
	end
	local character = Hit.Parent
	if character:IsA("Hat") then
		character = character.Parent
	end
	if character == Character then
		return
	end
	local humanoid = character:FindFirstChildOfClass('Humanoid')
	if not humanoid  or humanoid.Health == 0 then
		return
	end
	local player = Players:GetPlayerFromCharacter(character)
	if player and Functions.IsTeamMate(Player, player) then
		return
	end
	local DeterminedDamage = math.random(Configuration.Damage.MinValue, Configuration.Damage.MaxValue)
	Functions.UntagHumanoid(humanoid)
	Functions.TagHumanoid(humanoid, Player)
	humanoid:TakeDamage(DeterminedDamage)
end

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

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

function Unequipped()
	ToolEquipped = false
end

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

ServerControl.OnServerInvoke = (function(player, Mode, Value)
	if player ~= Player or not ToolEquipped or not CheckIfAlive() or not Mode or not Value then
		return
	end
	if Mode == "Fire" then
		Sounds.Fire:Play()
	elseif Mode == "RayHit" then
		local RayHit = Value.Hit
		local RayPosition = Value.Position
		if RayHit and RayPosition then
			RayTouched(RayHit, RayPosition)
		end
		if not FX.Enabled then
			FX.Enabled = true
			delay(0.1, function()
				FX.Enabled = false
			end)
		end
	elseif Mode == "CastLaser" then
		local StartPosition = Value.StartPosition
		local TargetPosition = Value.TargetPosition
		local RayHit = Value.RayHit
		if not StartPosition or not TargetPosition or not RayHit then
			return
		end
		for i, v in pairs(Players:GetPlayers()) do
			if v:IsA("Player") and v ~= Player then
				local Backpack = v:FindFirstChild("Backpack")
				if Backpack then
					local LaserScript = CastLaser:Clone()
					local StartPos = Instance.new("Vector3Value")
					StartPos.Name = "StartPosition"
					StartPos.Value = StartPosition
					StartPos.Parent = LaserScript
					local TargetPos = Instance.new("Vector3Value")
					TargetPos.Name = "TargetPosition"
					TargetPos.Value = TargetPosition
					TargetPos.Parent = LaserScript
					local RayHit = Instance.new("BoolValue")
					RayHit.Name = "RayHit"
					RayHit.Value = RayHit
					RayHit.Parent = LaserScript
					LaserScript.Disabled = false
					Debris:AddItem(LaserScript, 1.5)
					LaserScript.Parent = Backpack
				end
			end
		end
	end
end)

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


Prompt: --// Holstering

Response:
	HolsteringEnabled = false;
	HolsterPos = CFrame.new(0.140751064, 0, -0.616261482, -4.10752676e-08, -0.342020065, 0.939692616, -1.49501727e-08, 0.939692557, 0.342020094, -0.99999994, 0, -4.37113847e-08);

	}

return Settings


Prompt: -- Edit stuff here

Response:
DATA_STORE 		= "TopCoins" --< Name of the Data store values will be saved in

SCORE_UPDATE 	= 30 --< How often you want the leaderboards to update in seconds (no less than 30)

PLAYER_UPDATE 	= 30 --< How often you want the player's current stat to save in seconds (no less than 30)

PLAYER_SAVE 	= "leaderstats" --< Do not change unless you are using something that is not leaderstats

NAME_OF_STAT 	= "Coins" --< Name of the stat you want to save (HAS to be inside 'leaderstats' or whatever PLAYER_SAVE is)


Prompt: -- Tween

Response:
local tween = game:GetService("TweenService")
local info = TweenInfo.new(
	3,
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.InOut,
	0,
	false,
	0
)

local abrindo = {
	CFrame = cf1.CFrame
}

local fechando = {
    CFrame = doorpos
}

local create1 = tween:Create(portao,info,abrindo)
local create2 = tween:Create(portao,info,fechando)


Prompt: --[[Steering]]

Response:
	function Steering()
		--Mouse Steer
		if _MSteer then
			local msWidth = math.max(1,mouse.ViewSizeX*_Tune.Peripherals.MSteerWidth/200)
			local mdZone = _Tune.Peripherals.MSteerDZone/100
			local mST = ((mouse.X-mouse.ViewSizeX/2)/msWidth)
			if math.abs(mST)<=mdZone then
				_GSteerT = 0
			else
				_GSteerT = (math.max(math.min((math.abs(mST)-mdZone),(1-mdZone)),0)/(1-mdZone))^_Tune.MSteerExp * (mST / math.abs(mST))
			end
		end

		--Interpolate Steering
		if _GSteerC < _GSteerT then
			if _GSteerC<0 then
				_GSteerC = math.min(_GSteerT,_GSteerC+_Tune.ReturnSpeed)
			else
				_GSteerC = math.min(_GSteerT,_GSteerC+_Tune.SteerSpeed)
			end
		else
			if _GSteerC>0 then
				_GSteerC = math.max(_GSteerT,_GSteerC-_Tune.ReturnSpeed)
			else
				_GSteerC = math.max(_GSteerT,_GSteerC-_Tune.SteerSpeed)
			end
		end

		--Steer Decay Multiplier
		local sDecay = (1-math.min(car.DriveSeat.Velocity.Magnitude/_Tune.SteerDecay,1-(_Tune.MinSteer/100)))

		--Apply Steering
		for i,v in pairs(car.Wheels:GetChildren()) do
			if v.Name=="F" then
				v.Arm.Steer.CFrame=car.Wheels.F.Base.CFrame*CFrame.Angles(0,-math.rad(_GSteerC*_Tune.SteerInner*sDecay),0)
			elseif v.Name=="FL" then
				if _GSteerC>= 0 then
					v.Arm.Steer.CFrame=car.Wheels.FL.Base.CFrame*CFrame.Angles(0,-math.rad(_GSteerC*_Tune.SteerOuter*sDecay),0)
				else
					v.Arm.Steer.CFrame=car.Wheels.FL.Base.CFrame*CFrame.Angles(0,-math.rad(_GSteerC*_Tune.SteerInner*sDecay),0)
				end
			elseif v.Name=="FR" then
				if _GSteerC>= 0 then
					v.Arm.Steer.CFrame=car.Wheels.FR.Base.CFrame*CFrame.Angles(0,-math.rad(_GSteerC*_Tune.SteerInner*sDecay),0)
				else
					v.Arm.Steer.CFrame=car.Wheels.FR.Base.CFrame*CFrame.Angles(0,-math.rad(_GSteerC*_Tune.SteerOuter*sDecay),0)
				end
			end
		end
	end


Response:
RS:connect(function()
	local Forward = (Keys["w"] or Keys[string.char(17)])
	local Backward = (Keys["s"] or Keys[string.char(18)])
	local Right = (Keys["d"] or Keys[string.char(19)])
	local Left = (Keys["a"] or Keys[string.char(20)])

	if (Forward or Backward or Right or Left) then
		Walking, Idleing = true, false
	elseif (not (Forward and Backward and Right and Left)) then
		Walking, Idleing = false, true
	end
end)

M2.KeyDown:connect(function(Key) Keys[Key] = true end)
M2.KeyUp:connect(function(Key) Keys[Key] = false end)


Response:
local AimingCursor = "http://www.roblox.com/asset/?id=107455536"
local LockedCursor = "http://www.roblox.com/asset/?id=107455986"
local TargetCursor = "http://www.roblox.com/asset/?id=107455960"
local NormalCursor = "http://www.roblox.com/asset/?id=116176885"


Prompt: --[[Transmission]]

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

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

	--Automatic Settings
	Tune.AutoShiftMode	= "Speed"												--[[
	[Modes]
		"Speed"		: Shifts based on wheel speed
		"RPM"		: Shifts based on RPM											]]
	Tune.AutoUpThresh	= -200		--Automatic upshift point 	(relative to peak RPM, positive = Over-rev)
	Tune.AutoDownThresh = 1400		--Automatic downshift point (relative to peak RPM, positive = Under-rev)

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


Prompt: --Made by Luckymaxer

Response:
Seat = script.Parent
Model = Seat.Parent

Engine = Model:WaitForChild("Engine")
BeamPart = Model:WaitForChild("BeamPart")
Lights = Model:WaitForChild("Lights")
Seats = Model:WaitForChild("Seats")

Sounds = {
	Flying = Engine:WaitForChild("UFO_Flying"),
	Beam = Engine:WaitForChild("UFO_Beam"),
	Idle = Engine:WaitForChild("UFO_Idle"),
	TakingOff = Engine:WaitForChild("UFO_Taking_Off")
}

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

BeamSize = 50
CurrentBeamSize = 0

MaxVelocity = 40
MinVelocity = -40

MaxSideVelocity = 40
MinSideVelocity = -40

Acceleration = 2
Deceleration = 2
AutoDeceleration = 2

SideAcceleration = 2
SideDeceleration = 2
AutoSideDeceleration = 2

LiftOffSpeed = 5
LiftSpeed = 10
LowerSpeed = -10

Velocity = Vector3.new(0, 0, 0)
SideVelocity = 0

FlipForce = 1000000

InUse = false
PlayerUsing = nil
PlayerControlScript = nil
PlayerConnection = nil
BeamActive = false
TakingOff = false

LightsEnabled = false

Enabled = false

Controls = {
	Forward = {Key = "W", Byte = 17, Mode = false},
	Backward = {Key = "S", Byte = 18, Mode = false},
	Left = {Key = "A", Byte = 20, Mode = false},
	Right = {Key = "D", Byte = 19, Mode = false},
	Up = {Key = "Q", Byte = 113, Mode = false},
	Down = {Key = "E", Byte = 101, Mode = false},
}

ControlScript = script:WaitForChild("ControlScript")

Beam = Instance.new("Part")
Beam.Name = "Beam"
Beam.Transparency = 0.3
Beam.BrickColor = BrickColor.new("Lime green")
Beam.Material = Enum.Material.Plastic
Beam.Shape = Enum.PartType.Block
Beam.TopSurface = Enum.SurfaceType.Smooth
Beam.BottomSurface = Enum.SurfaceType.Smooth
Beam.FormFactor = Enum.FormFactor.Custom
Beam.Size = Vector3.new(BeamPart.Size.X, 0.2, BeamPart.Size.Z)
Beam.Anchored = false
Beam.CanCollide = false
BeamMesh = Instance.new("CylinderMesh")
BeamMesh.Parent = Beam

for i, v in pairs(Sounds) do
	v:Stop()
end

RemoteConnection = script:FindFirstChild("RemoteConnection")
if not RemoteConnection then
	RemoteConnection = Instance.new("RemoteFunction")
	RemoteConnection.Name = "RemoteConnection"
	RemoteConnection.Parent = script
end

BodyGyro = Engine:FindFirstChild("BodyGyro")
if not BodyGyro then
	BodyGyro = Instance.new("BodyGyro")
	BodyGyro.Parent = Engine
end
BodyGyro.maxTorque = Vector3.new(0, 0, 0)
BodyGyro.D = 7500
BodyGyro.P = 10000

BodyPosition = Engine:FindFirstChild("BodyPosition")
if not BodyPosition then
	BodyPosition = Instance.new("BodyPosition")
	BodyPosition.Parent = Engine
end
BodyPosition.maxForce = Vector3.new(0, 0, 0)
BodyPosition.D = 10000
BodyPosition.P = 50000

BodyVelocity = Engine:FindFirstChild("BodyVelocity")
if not BodyVelocity then
	BodyVelocity = Instance.new("BodyVelocity")
	BodyVelocity.Parent = Engine
end
BodyVelocity.velocity = Vector3.new(0, 0, 0)
BodyVelocity.maxForce = Vector3.new(0, 0, 0)
BodyVelocity.P = 10000

FlipGyro = BeamPart:FindFirstChild("FlipGyro")
if not FlipGyro then
	FlipGyro = Instance.new("BodyGyro")
	FlipGyro.Name = "FlipGyro"
	FlipGyro.Parent = BeamPart
end
FlipGyro.maxTorque = Vector3.new(0, 0, 0)
FlipGyro.D = 500
FlipGyro.P = 3000

RiseVelocity = BeamPart:FindFirstChild("RiseVelocity")
if not RiseVelocity then
	RiseVelocity = Instance.new("BodyVelocity")
	RiseVelocity.Name = "RiseVelocity"
	RiseVelocity.Parent = BeamPart
end
RiseVelocity.velocity = Vector3.new(0, 0, 0)
RiseVelocity.maxForce = Vector3.new(0, 0, 0)
RiseVelocity.P = 10000

function RayCast(Position, Direction, MaxDistance, IgnoreList)
	return game:GetService("Workspace"):FindPartOnRayWithIgnoreList(Ray.new(Position, Direction.unit * (MaxDistance or 999.999)), IgnoreList)
end

function ToggleLights()
	for i, v in pairs(Lights:GetChildren()) do
		if v:IsA("BasePart") then
			for ii, vv in pairs(v:GetChildren()) do
				if vv:IsA("Light") then
					vv.Enabled = LightsEnabled
				end
			end
		end
	end
end

ToggleLights()

function CheckTable(Table, Instance)
	for i, v in pairs(Table) do
		if v == Instance then
			return true
		end
	end
	return false
end

function RandomizeTable(Table)
	local TableCopy = {}
	for i = 1, #Table do
		local Index = math.random(1, #Table)
		table.insert(TableCopy, Table[Index])
		table.remove(Table, Index)
	end
	return TableCopy
end

for i, v in pairs(Model:GetChildren()) do
	if v:IsA("BasePart") and v.Name == "Beam" then
		v:Destroy()
	end
end

function GetPartsInBeam(beam)
	local IgnoreObjects = {(((PlayerUsing and PlayerUsing.Character) and PlayerUsing.Character) or nil), Model}
	local NegativePartRadius = Vector3.new((beam.Size.X / 2), ((CurrentBeamSize / 5) / 2), (beam.Size.Z / 2))
	local PositivePartRadius = Vector3.new((beam.Size.X / 2), ((CurrentBeamSize / 5) / 2), (beam.Size.Z / 2))
	local Parts = game:GetService("Workspace"):FindPartsInRegion3WithIgnoreList(Region3.new(beam.Position - NegativePartRadius, beam.Position + PositivePartRadius), IgnoreObjects, 100)
	local Humanoids = {}
	local Torsos = {}
	for i, v in pairs(Parts) do
		if v and v.Parent then
			local humanoid = v.Parent:FindFirstChild("Humanoid")
			local torso = v.Parent:FindFirstChild("Torso")
			local player = Players:GetPlayerFromCharacter(v.Parent)
			if player and humanoid and humanoid.Health > 0 and torso and not CheckTable(Humanoids, humanoid) then
				table.insert(Humanoids, humanoid)
				table.insert(Torsos, {Humanoid = humanoid, Torso = torso})
			end
		end
	end
	return Torsos
end

RemoteConnection.OnServerInvoke = (function(Player, Script, Action, Value)
	if Script and Script ~= PlayerControlScript then
		Script.Disabled = true
		Script:Destroy()
	else
		if Action == "KeyDown" then
			if Value == "l" then
				LightsEnabled = not LightsEnabled
				ToggleLights()
			elseif Value == "t" then
				if TemporaryBeam and TemporaryBeam.Parent then
					local Torsos = GetPartsInBeam(TemporaryBeam)
					local TorsosUsed = {}
					Torsos = RandomizeTable(Torsos)
					for i, v in pairs(Seats:GetChildren()) do
						if v:IsA("Seat") and not v:FindFirstChild("SeatWeld") then
							for ii, vv in pairs(Torsos) do
								if vv.Humanoid and vv.Humanoid.Parent and vv.Humanoid.Health > 0 and not vv.Humanoid.Sit and vv.Torso and vv.Torso.Parent and not CheckTable(TorsosUsed, vv.Torso) then
									table.insert(TorsosUsed, vv.Torso)
									vv.Torso.CFrame = v.CFrame
									break
								end
							end
						end
					end
				end
			end
			if not TakingOff then
				for i, v in pairs(Controls) do
					if string.lower(v.Key) == string.lower(Value) or v.Byte == string.byte(Value) then
						v.Mode = true
					end
				end
				if Controls.Up.Mode or Controls.Down.Mode then
					RiseVelocity.maxForce = Vector3.new(0, 1000000, 0)
				end
				if Controls.Forward.Mode or Controls.Backward.Mode or Controls.Left.Mode or Controls.Right.Mode or Controls.Up.Mode or Controls.Down.Mode then
					Sounds.Idle:Stop()
					Sounds.Flying:Play()
				end
			end
		elseif Action == "KeyUp" then
			if not TakingOff then
				for i, v in pairs(Controls) do
					if string.lower(v.Key) == string.lower(Value) or v.Byte == string.byte(Value) then
						v.Mode = false
					end
				end
				if not Controls.Up.Mode and not Controls.Down.Mode then
					BodyPosition.position = Engine.Position
					BodyPosition.maxForce = Vector3.new(0, 100000000, 0)
					RiseVelocity.maxForce = Vector3.new(0, 0, 0)
					RiseVelocity.velocity = Vector3.new(0, 0, 0)
				end
				if not Controls.Forward.Mode and not Controls.Backward.Mode and not Controls.Left.Mode and not Controls.Right.Mode and not Controls.Up.Mode and not Controls.Down.Mode then
					Sounds.Flying:Stop()
					Sounds.Idle:Play()
				end
			end
		elseif Action == "Button1Down" then
			if not BeamActive and not TakingOff then
				BeamActive = true
				if TemporaryBeam and TemporaryBeam.Parent then
					TemporaryBeam:Destroy()
				end
				TemporaryBeam = Beam:Clone()
				TemporaryBeam.Parent = Model
				Spawn(function()
					while TemporaryBeam and TemporaryBeam.Parent do
						local Torsos = GetPartsInBeam(TemporaryBeam)
						for i, v in pairs(Torsos) do
							if v.Humanoid and v.Humanoid.Parent and v.Humanoid.Health > 0 and v.Torso and v.Torso.Parent and not v.Torso:FindFirstChild("UFOPullForce") and not v.Torso:FindFirstChild("UFOBalanceForce") then
								local UFOPullForce = Instance.new("BodyVelocity")
								UFOPullForce.Name = "UFOPullForce"
								UFOPullForce.maxForce = Vector3.new(0, 1000000, 0)
								UFOPullForce.velocity = CFrame.new(v.Torso.Position, BeamPart.Position).lookVector * 25
								Debris:AddItem(UFOPullForce, 0.25)
								UFOPullForce.Parent = v.Torso
								local UFOBalanceForce = Instance.new("BodyGyro")
								UFOBalanceForce.Name = "UFOBalanceForce"
								UFOBalanceForce.maxTorque = Vector3.new(1000000, 0, 1000000)
								Debris:AddItem(UFOBalanceForce, 0.25)
								UFOBalanceForce.Parent = v.Torso
							end
						end
						wait()
					end
				end)
				local BeamWeld = Instance.new("Weld")
				BeamWeld.Part0 = BeamPart
				BeamWeld.Part1 = TemporaryBeam
				Spawn(function()
					Sounds.Beam:Play()
					while Enabled and BeamActive and TemporaryBeam and TemporaryBeam.Parent do
						local IgnoreTable = {Model}
						for i, v in pairs(Players:GetChildren()) do
							if v:IsA("Player") and v.Character then
								table.insert(IgnoreTable, v.Character)
							end
						end
						local BeamPartClone = BeamPart:Clone()
						local BeamPartCloneY = BeamPartClone:Clone()
						BeamPartCloneY.CFrame = BeamPartCloneY.CFrame * CFrame.Angles(-math.rad(90), 0, 0)
						BeamPartCloneY.CFrame = BeamPartCloneY.CFrame - BeamPartCloneY.CFrame.lookVector * ((BeamPart.Size.Y / 2))
						local Hit, Position = RayCast(BeamPart.Position, BeamPartCloneY.CFrame.lookVector, BeamSize, IgnoreTable)
						CurrentBeamSize = ((BeamPart.Position - Position).magnitude * 5)
						TemporaryBeam.Mesh.Scale = Vector3.new(1, CurrentBeamSize, 1)
						BeamWeld.Parent = TemporaryBeam
						BeamWeld.C0 = CFrame.new(0, 0, 0) - Vector3.new(0, ((CurrentBeamSize / 2) + (BeamPart.Size.Y / 2)) / 5 , 0)
						wait()
					end
					BeamActive = false
					Sounds.Beam:Stop()
					if TemporaryBeam and TemporaryBeam.Parent then
						TemporaryBeam:Destroy()
					end
				end)
			end
		elseif Action == "Button1Up" then
			BeamActive = false
		end
	end
end)

function ManageMotionStep(ForceLift, CoordinateFrame)

	local CameraForwards = -CoordinateFrame:vectorToWorldSpace(Vector3.new(0, 0, 1))
	local CameraSideways = -CoordinateFrame:vectorToWorldSpace(Vector3.new(1, 0, 0))
	local CameraRotation = -CoordinateFrame:vectorToWorldSpace(Vector3.new(0, 1, 0))

	CameraForwards = CameraForwards * Vector3.new(1, 0, 1)
	CameraSideways = CameraSideways * Vector3.new(1, 0, 1)

	if CameraForwards:Dot(CameraForwards) < 0.1 or CameraSideways:Dot(CameraSideways) < 0.1 then
		return
	end

	CameraForwards = CameraForwards.unit
	CameraSideways = CameraSideways.unit

	if math.abs(Velocity.X) < 2 and math.abs(Velocity.Z) < 2 then
		BodyVelocity.velocity = Vector3.new(0, 0, 0)
	else
		BodyVelocity.velocity = Velocity
	end
	BodyGyro.cframe = CFrame.new(0, 0, 0) * CFrame.Angles(Velocity:Dot(Vector3.new(0, 0, 1)) * (math.pi / 320), 0, math.pi - Velocity:Dot(Vector3.new(1, 0, 0)) * (math.pi / 320))
	if Controls.Forward.Mode and (not Controls.Backward.Mode) and Velocity:Dot(CameraForwards) < MaxVelocity then
		Velocity = Velocity + Acceleration * CameraForwards
	elseif Controls.Backward.Mode and (not Controls.Forward.Mode) and Velocity:Dot(CameraForwards) > MinVelocity then
		Velocity = Velocity - Deceleration * CameraForwards
	elseif (not Controls.Backward.Mode) and (not Controls.Forward.Mode) and Velocity:Dot(CameraForwards) > 0 then
		Velocity = Velocity - AutoDeceleration * CameraForwards
	elseif (not Controls.Backward.Mode) and (not Controls.Forward.Mode) and Velocity:Dot(CameraForwards) < 0 then
		Velocity = Velocity + AutoDeceleration * CameraForwards
	end

	if Controls.Left.Mode and (not Controls.Right.Mode) and Velocity:Dot(CameraSideways) < MaxSideVelocity then
		Velocity = Velocity + SideAcceleration * CameraSideways
	elseif Controls.Right.Mode and (not Controls.Left.Mode) and Velocity:Dot(CameraSideways) > MinSideVelocity then
		Velocity = Velocity - SideDeceleration * CameraSideways
	elseif (not Controls.Right.Mode) and (not Controls.Left.Mode) and Velocity:Dot(CameraSideways) > 0 then
		Velocity = Velocity - AutoSideDeceleration * CameraSideways
	elseif (not Controls.Right.Mode) and (not Controls.Left.Mode) and Velocity:Dot(CameraSideways) < 0 then
		Velocity = Velocity + AutoSideDeceleration * CameraSideways
	end

	if ForceLift then
		RiseVelocity.velocity = Vector3.new(0, LiftOffSpeed, 0)
	else
		if Controls.Up.Mode and (not Controls.Down.Mode) then
			RiseVelocity.velocity = Vector3.new(0, LiftSpeed, 0)
			BodyPosition.maxForce = Vector3.new(0, 0, 0)
		elseif Controls.Down.Mode and (not Controls.Up.Mode) then
			RiseVelocity.velocity = Vector3.new(0, LowerSpeed, 0)
			BodyPosition.maxForce = Vector3.new(0, 0, 0)
		end
	end

end

function MotionManager()
	Spawn(function()
		TakingOff = true
		RiseVelocity.maxForce = Vector3.new(0, 1000000, 0)
		local StartTime = tick()
		Sounds.TakingOff:Play()
		while Enabled and PlayerConnection and (tick() - StartTime) < 3 do
			local CoordinateFrame = PlayerConnection:InvokeClient(PlayerUsing, "CoordinateFrame")
			ManageMotionStep(true, CoordinateFrame)
			wait()
		end
		TakingOff = false
		Sounds.TakingOff:Stop()
		while PlayerConnection and (Enabled or Velocity:Dot(Velocity) > 0.5) do
			local CoordinateFrame = PlayerConnection:InvokeClient(PlayerUsing, "CoordinateFrame")
			ManageMotionStep(false, CoordinateFrame)
			wait()
		end
	end)
end

function LiftOff()

	BodyGyro.maxTorque = Vector3.new(1000000, 1000000, 1000000)
	BodyVelocity.maxForce = Vector3.new(1000000, 0, 1000000)

	Velocity = Vector3.new(0, 0, 0)

	Enabled = true

	MotionManager()

end

function Equipped(Player)
	local Backpack = Player:FindFirstChild("Backpack")
	if Backpack then
		InUse = true
		PlayerUsing = Player
		PlayerControlScript = ControlScript:Clone()
		local RemoteController = Instance.new("ObjectValue")
		RemoteController.Name = "RemoteController"
		RemoteController.Value = RemoteConnection
		RemoteController.Parent = PlayerControlScript
		local VehicleSeat = Instance.new("ObjectValue")
		VehicleSeat.Name = "VehicleSeat"
		VehicleSeat.Value = Seat
		VehicleSeat.Parent = PlayerControlScript
		PlayerConnection = Instance.new("RemoteFunction")
		PlayerConnection.Name = "PlayerConnection"
		PlayerConnection.Parent = PlayerControlScript
		PlayerControlScript.Disabled = false
		PlayerControlScript.Parent = Backpack
		LiftOff()
	end
end

function Unequipped()
	if PlayerControlScript and PlayerControlScript.Parent then
		PlayerControlScript:Destroy()
	end
	Enabled = false
	PlayerControlScript = nil
	PlayerUsing = nil
	PlayerConnection = nil
	BeamActive = false
	TakingOff = false
	InUse = false
	BodyGyro.maxTorque = Vector3.new(0, 0, 0)
	BodyPosition.maxForce = Vector3.new(0, 0, 0)
	BodyVelocity.maxForce = Vector3.new(0, 0, 0)
	BodyVelocity.velocity = Vector3.new(0, 0, 0)
	RiseVelocity.maxForce = Vector3.new(0, 0, 0)
	RiseVelocity.velocity = Vector3.new(0, 0, 0)
	for i, v in pairs(Controls) do
		v.Mode = false
	end
end

function Flip()
	local EngineCloneY = Engine:Clone()
	EngineCloneY.CFrame = EngineCloneY.CFrame * CFrame.Angles(-math.rad(90), 0, 0)
	if EngineCloneY.CFrame.lookVector.Y < 0.707 then
		FlipGyro.cframe = CFrame.new(Vector3.new(0, 0, 0), Vector3.new(0, 1, 0)) * CFrame.Angles((-math.pi / 2), 0, 0)
		FlipGyro.maxTorque = Vector3.new(FlipForce, FlipForce, FlipForce)
		wait(2)
		FlipGyro.maxTorque = Vector3.new(0,0,0)
	end
end

Seat.ChildAdded:connect(function(Child)
	if Child:IsA("Weld") and Child.Name == "SeatWeld" then
		if Child.Part0 and Child.Part0 == Seat and Child.Part1 and Child.Part1.Parent then
			local Player = Players:GetPlayerFromCharacter(Child.Part1.Parent)
			if Player then
				Equipped(Player)
			end
		end
	end
end)

Seat.ChildRemoved:connect(function(Child)
	if Child:IsA("Weld") and Child.Name == "SeatWeld" then
		if Child.Part0 and Child.Part0 == Seat and Child.Part1 and Child.Part1.Parent then
			local Player = Players:GetPlayerFromCharacter(Child.Part1.Parent)
			if Player and Player == PlayerUsing then
				Unequipped(Player)
			end
		end
	end
end)

Spawn(function()
	while true do
		Flip()
		wait(5)
	end
end)