Prompt: -- BrailleGen 3D BETA

Response:
Align = true

This = script.Parent
Btn = This.Parent
Lift = Btn.Parent.Parent.Parent
Config = require(Lift.CustomLabel)
Characters = require(script.Characters)

CustomLabel = Config["CUSTOMFLOORLABEL"][tonumber(Btn.Name)]

function ChangeFloor(SF)
	if Align == true then
		if string.len(SF) == 1 then
			SetLabel(1,SF,0.045)
			SetLabel(2,"NIL",0)
			SetLabel(3,"NIL",0)
			SetLabel(4,"NIL",0)
		elseif string.len(SF) == 2 then
			SetLabel(1,SF:sub(1,1),0.03)
			SetLabel(2,SF:sub(2,2),0.03)
			SetLabel(3,"NIL",0)
			SetLabel(4,"NIL",0)
		elseif string.len(SF) == 3 then
			SetLabel(1,SF:sub(1,1),0.015)
			SetLabel(2,SF:sub(2,2),0.015)
			SetLabel(3,SF:sub(3,3),0.015)
			SetLabel(4,"NIL",0)
		elseif string.len(SF) == 4 then
			SetLabel(1,SF:sub(1,1),0)
			SetLabel(2,SF:sub(2,2),0)
			SetLabel(3,SF:sub(3,3),0)
			SetLabel(4,SF:sub(4,4),0)
		end
	else
		if string.len(SF) == 1 then
			SetLabel(1,SF,0)
			SetLabel(2,"NIL",0)
			SetLabel(3,"NIL",0)
			SetLabel(4,"NIL",0)
		elseif string.len(SF) == 2 then
			SetLabel(1,SF:sub(1,1),0)
			SetLabel(2,SF:sub(2,2),0)
			SetLabel(3,"NIL",0)
			SetLabel(4,"NIL",0)
		elseif string.len(SF) == 3 then
			SetLabel(1,SF:sub(1,1),0)
			SetLabel(2,SF:sub(2,2),0)
			SetLabel(3,SF:sub(3,3),0)
			SetLabel(4,"NIL",0)
		elseif string.len(SF) == 4 then
			SetLabel(1,SF:sub(1,1),0)
			SetLabel(2,SF:sub(2,2),0)
			SetLabel(3,SF:sub(3,3),0)
			SetLabel(4,SF:sub(4,4),0)
		end
	end
end

function SetLabel(ID,CHAR,OFFSET)
	if This:FindFirstChild("BR"..ID) and Characters[CHAR] ~= nil then
		for i,l in pairs(Characters[CHAR]) do
			This["BR"..ID].Mesh.MeshId = "rbxassetid://"..l
		end
		if CHAR == "A" or CHAR == "1" then
			This["BR"..ID].Mesh.Offset = Vector3.new(OFFSET-0.006, 0, -0.014)
		elseif CHAR == "B" or CHAR == "2" then
			This["BR"..ID].Mesh.Offset = Vector3.new(OFFSET-0.006, 0, -0.006)
		elseif CHAR == "C" or CHAR == "3" then
			This["BR"..ID].Mesh.Offset = Vector3.new(OFFSET, 0, -0.014)
		elseif CHAR == "D" or CHAR == "4" or CHAR == "E" or CHAR == "5" or CHAR == "F" or CHAR == "6" or CHAR == "G" or CHAR == "7" or CHAR == "H" or CHAR == "8" or CHAR == "I" or CHAR == "9" or CHAR == "J" or CHAR == "0" then
			This["BR"..ID].Mesh.Offset = Vector3.new(OFFSET, 0, -0.006)
		elseif CHAR == "K" or CHAR == "L" then
			This["BR"..ID].Mesh.Offset = Vector3.new(OFFSET-0.006, 0, 0)
		elseif CHAR == "." or CHAR == "+" then
			This["BR"..ID].Mesh.Offset = Vector3.new(OFFSET, 0, 0.006)
		elseif CHAR == "-" then
			This["BR"..ID].Mesh.Offset = Vector3.new(OFFSET, 0, 0.014)
		elseif CHAR == ";" then
			This["BR"..ID].Mesh.Offset = Vector3.new(OFFSET, 0, 0.006)
		elseif CHAR == "*" then
			This["BR"..ID].Mesh.Offset = Vector3.new(OFFSET+0.006, 0, 0)
		else
			This["BR"..ID].Mesh.Offset = Vector3.new(OFFSET, 0, 0)
		end
	end
end

if CustomLabel then
	if string.find(string.sub(CustomLabel,1,1), "%d") ~= nil then
		if string.len(CustomLabel) == 1 then ChangeFloor("$"..CustomLabel)
		elseif string.find(string.sub(CustomLabel,2,2), "%a") ~= nil then ChangeFloor("$"..string.sub(CustomLabel,1,1)..";"..string.sub(CustomLabel,2,2))
		else ChangeFloor("$"..CustomLabel)
		end
	elseif string.find(CustomLabel, "%d") == nil then
		if string.len(CustomLabel) == 1 then ChangeFloor(";"..CustomLabel)
		elseif string.find(string.sub(CustomLabel,2,2), "%d") ~= nil then ChangeFloor(";"..string.sub(CustomLabel,1,1).."$"..string.sub(CustomLabel,2,2))
		else ChangeFloor(";"..CustomLabel)
		end
	else
		ChangeFloor(string.sub(CustomLabel,1,1).."$"..string.sub(CustomLabel,2,2))
	end
else
	ChangeFloor("$"..Btn.Name)
end

script:Destroy()


Prompt: --!native

Response:
local CollisionModule = {}

local sin = math.sin
local cos = math.cos
local sqrt = math.sqrt
local tan = math.tan
local floor = math.floor
local rad = math.rad

local max = math.max
local min = math.min
local huge = math.huge
local abs = math.abs
local sign = math.sign

local pi = math.pi

local function GetBoundingBox(points, offset)
	offset = offset or Vector3.zero

	local minX, minY, minZ = huge, huge, huge
	local maxX, maxY, maxZ = -huge, -huge, -huge

	for _, point in pairs(points) do
		local x, y, z = unpack(point)

		x = x + offset.X
		y = y + offset.Y
		z = z + offset.Z

		minX = min(minX, x)
		minY = min(minY, y)
		minZ = min(minZ, z)

		maxX = max(maxX, x)
		maxY = max(maxY, y)
		maxZ = max(maxZ, z)
	end

	return {
		Min = Vector3.new(minX, minY, minZ),
		Max = Vector3.new(maxX, maxY, maxZ)
	}
end

local function IsPointInsideModel(model, point)
	local bounds = GetBoundingBox(model.points)
	return point.X >= bounds.Min.X and point.X <= bounds.Max.X
		and point.Y >= bounds.Min.Y and point.Y <= bounds.Max.Y
		and point.Z >= bounds.Min.Z and point.Z <= bounds.Max.Z
end

local function DoesRayIntersectModel(ray, model)
	local origin = ray.Origin
	local direction = ray.Direction
	local intersectionPoint = nil

	-- Check if the ray's origin is inside the model
	if IsPointInsideModel(model, origin) then
		intersectionPoint = origin
		return true, intersectionPoint
	end

	-- Check for intersections with each model point
	local points = model.points
	for _, vertex in pairs(points) do
		local point = Vector3.new(vertex[1], vertex[2], vertex[3])
		local hitDistance = (point - origin):Dot(direction)
		if hitDistance >= 0 and IsPointInsideModel(model, origin + hitDistance * direction) then
			intersectionPoint = origin + hitDistance * direction
			return true, intersectionPoint
		end
	end

	return false, nil
end

local function CalculateMouseRay(mouseX, mouseY, Camera, viewportWidth, viewportHeight)
	local cameraCFrame = Camera:GetCFrame()
	local cameraInverseCFrame = cameraCFrame:Inverse()
	local mousePosition = Vector3.new(mouseX, mouseY, 0)

	local mouseRayDirection = (mousePosition - Vector3.new(viewportWidth / 2, viewportHeight / 2, 0)) / sqrt(viewportWidth ^ 2 + viewportHeight ^ 2) * 2

	local mouseRayWorldDirection = (cameraInverseCFrame * mouseRayDirection).unit
	return Ray.new(Camera.Position, mouseRayWorldDirection)
end

local function GetIntersectionPoint(ray, model)
	local origin = ray.Origin
	local direction = ray.Direction

	local closestDistance = huge
	local intersectionPoint = nil

	-- Check for intersections with each model point
	local points = model.points
	for _, vertex in pairs(points) do
		local point = Vector3.new(vertex[1], vertex[2], vertex[3])
		local hitDistance = (point - origin):Dot(direction)
		if hitDistance >= 0 and IsPointInsideModel(model, origin + hitDistance * direction) then
			-- Update the closest intersection point if this point is closer to the ray's origin
			if hitDistance < closestDistance then
				closestDistance = hitDistance
				intersectionPoint = origin + hitDistance * direction
			end
		end
	end

	return intersectionPoint
end

local function CalculateSurfaceNormal(model, hitPoint)
	local points = model.points
	local normalsSum = Vector3.zero

	local closestNormal = Vector3.zero
	local closestDistance = huge

	for _, triangle in pairs(model.triangles) do
		local vertex1 = Vector3.new(points[triangle[1]][1], points[triangle[1]][2], points[triangle[1]][3])
		local vertex2 = Vector3.new(points[triangle[2]][1], points[triangle[2]][2], points[triangle[2]][3])
		local vertex3 = Vector3.new(points[triangle[3]][1], points[triangle[3]][2], points[triangle[3]][3])

		local edge1 = vertex2 - vertex1
		local edge2 = vertex3 - vertex1
		local normal = edge1:Cross(edge2).unit

		local distanceToPlane = normal:Dot(vertex1 - hitPoint)
		if abs(distanceToPlane) < 0.001 then
			normalsSum = normalsSum + normal
		end

		if distanceToPlane < closestDistance then
			closestNormal = normal
			closestDistance = distanceToPlane
		end

	end

	if normalsSum.Magnitude == 0 then
		return closestNormal.unit
	else
		return normalsSum.unit
	end
end

function CollisionModule.Raycast(origin, direction, whitelist)
	local ray = Ray.new(origin, direction)

	-- Check for collisions with each model in the whitelist
	for _, model in pairs(whitelist) do
		local doesIntersect, intersectionPoint = DoesRayIntersectModel(ray, model)
		if doesIntersect then
			return model.Name, intersectionPoint
		end
	end

	return nil, nil
end

function CollisionModule.RaycastWithNormals(origin, direction, blacklist, registry)
	local ray = Ray.new(origin, direction)
	local hitModel, hitPoint, surfaceNormal = nil, nil, nil
	local closestDistance = huge

	for i, model in pairs(registry) do
		if table.find(blacklist, model.Name) == nil then
			local doesIntersect, intersectionPoint = DoesRayIntersectModel(ray, model)

			if doesIntersect then
				local hitDistance = (intersectionPoint - origin).Magnitude

				if hitDistance < closestDistance then
					hitModel = model
					hitPoint = intersectionPoint
					surfaceNormal = CalculateSurfaceNormal(model, hitPoint)
					closestDistance = hitDistance
				end
			end
		end
	end

	return hitModel, hitPoint, surfaceNormal
end

function CollisionModule.AABBCollision(model1, model2, offset)
	local bounds1 = GetBoundingBox(model1.points, offset)
	local bounds2 = GetBoundingBox(model2.points)

	-- Check for collision along each axis (X, Y, Z)
	local collisionX = bounds1.Min.X <= bounds2.Max.X and bounds1.Max.X >= bounds2.Min.X
	local collisionY = bounds1.Min.Y <= bounds2.Max.Y and bounds1.Max.Y >= bounds2.Min.Y
	local collisionZ = bounds1.Min.Z <= bounds2.Max.Z and bounds1.Max.Z >= bounds2.Min.Z

	-- If there's a collision along all three axes, there's a collision
	if collisionX and collisionY and collisionZ then
		-- Calculate the collision normal (direction of collision)
		local collisionNormal = Vector3.new(0, 0, 0)

		-- Determine which side was hit based on the minimum penetration depth along each axis
		local minPenetrationX = min(bounds1.Max.X - bounds2.Min.X, bounds2.Max.X - bounds1.Min.X)
		local minPenetrationY = min(bounds1.Max.Y - bounds2.Min.Y, bounds2.Max.Y - bounds1.Min.Y)
		local minPenetrationZ = min(bounds1.Max.Z - bounds2.Min.Z, bounds2.Max.Z - bounds1.Min.Z)

		-- Find the axis with the minimum penetration depth
		local minPenetration = min(minPenetrationX, minPenetrationY, minPenetrationZ)

		if minPenetration == minPenetrationX then
			collisionNormal = Vector3.new(sign(bounds1.Max.X - bounds2.Min.X), 0, 0)
		elseif minPenetration == minPenetrationY then
			collisionNormal = Vector3.new(0, sign(bounds1.Max.Y - bounds2.Min.Y), 0)
		else
			collisionNormal = Vector3.new(0, 0, sign(bounds1.Max.Z - bounds2.Min.Z))
		end

		return true, collisionNormal
	end

	return false, nil, 0
end

function CollisionModule.IsModelInside(model1, model2)
	local bounds1 = GetBoundingBox(model1.points)
	local bounds2 = GetBoundingBox(model2.points)

	return bounds1.Min.X >= bounds2.Min.X and bounds1.Min.Y >= bounds2.Min.Y and bounds1.Min.Z >= bounds2.Min.Z
		and bounds1.Max.X <= bounds2.Max.X and bounds1.Max.Y <= bounds2.Max.Y and bounds1.Max.Z <= bounds2.Max.Z
end

return CollisionModule


Prompt:
--[[**
		wraps a callback in an assert with checkArgs

		@param callback The function to wrap
		@param checkArgs The functon to use to check arguments in the assert

		@returns A function that first asserts using checkArgs and then calls callback
	**--]]

Response:
	function t.wrap(callback, checkArgs)
		assert(checkWrap(callback, checkArgs))
		return function(...)
			assert(checkArgs(...))
			return callback(...)
		end
	end
end


Prompt:
--[[

TODO: Clone and toss the tool handle and display, putting them into a new model and into workspace.Debris. When the handle is touched by a descendant of workspace.Enemies, trap them

]]


Prompt:
-- ================================================================================
-- SETTINGS
-- ================================================================================

Response:
GameSettings.intermissionDuration = 10		-- Duration of intermission in seconds
GameSettings.roundDuration = 60			-- Durationof race in seconds
GameSettings.countdownDuration = 3			-- Race countdown at starting line in seconds
GameSettings.minimumPlayers = 1			-- Minimum number of players for a race to start
GameSettings.transitionEnd = 3				-- Duration of time between end of race and beginning of
											-- next intermission


Prompt:
--[=[
	@param andThenFn (value: any) -> Option
	@return value: Option
	If the option holds a value, then the `andThenFn`
	function is called with the held value of the option,
	and then the resultant Option returned by the `andThenFn`
	is returned. Otherwise, None is returned.

	```lua
	local optA = Option.Some(32)
	local optB = optA:AndThen(function(num)
		return Option.Some(num * 2)
	end)
	print(optB:Expect("Expected number")) --> 64
	```
]=]

Response:
function Option:AndThen(andThenFn)
	if self:IsSome() then
		local result = andThenFn(self:Unwrap())
		Option.Assert(result)
		return result
	else
		return Option.None
	end
end


Prompt:
--[=[
	Returns a unique render name for every call, which can
	be used with the `BindToRenderStep` method optionally.

	```lua
	shake:BindToRenderStep(Shake.NextRenderName(), ...)
	```
]=]

Response:
function Shake.NextRenderName(): string
	renderId += 1
	return ("__shake_%.4i__"):format(renderId)
end


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(-100,100)*0.5,math.random(-100,100)*0.1,math.random(-100,100)*0.5)
	wait(math.random(10,25)*0.1)
end


Prompt: --This module is for any client FX related to the Lab's door

Response:
local WoodenBarrierFX = {}

local tweenService = game:GetService("TweenService")

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

function WoodenBarrierFX.BREAK(plank)
	if not plank then return end

	plank.Transparency = 1
	local plankClone = plank:Clone()
	plankClone.Transparency = 0
	plankClone.CanCollide = false
	plankClone.CanTouch = false
	plankClone.Massless = true
	plankClone.Anchored = true

	local smoke = script.Smoke:Clone()
	smoke.Parent = plankClone

	plankClone.Parent = workspace.Ignore
	tweenService:Create(plankClone, TweenInfo.new(2, Enum.EasingStyle.Sine, Enum.EasingDirection.In), {Transparency = 1}):Play()
	game.Debris:AddItem(plankClone, 2)

	plankClone.CFrame = plank.CFrame

	local velo = plank.CFrame.UpVector * (-25 - math.random() * 10)
	plankClone.Anchored = false
	plankClone.Velocity = velo + Vector3.new(0, 25 + math.random() * 10, 0)
	plankClone.RotVelocity = Vector3.new(math.random() * 20 - 10, math.random() * 20 - 10, math.random() * 20 - 10)
	smoke:Emit(60)

end

function WoodenBarrierFX.BUILD(plank)
	if not plank then return end

	plank.Transparency = 1
	local plankClone = plank:Clone()
	plankClone.Transparency = 1
	plankClone.CanCollide = false
	plankClone.CanTouch = false
	plankClone.Massless = true

	local smoke = script.Smoke:Clone()
	smoke.Parent = plankClone
	local sparks = script.Sparks:Clone()
	sparks.Parent = plankClone

	plankClone.Parent = workspace.Ignore
	game.Debris:AddItem(plankClone, 3)

	local midCf = plank.CFrame * CFrame.new(0, -5, 0)
	local startCf = midCf - Vector3.new(0, 5, 0)
	local endCf = plank.CFrame

	plankClone.CFrame = startCf
	tweenService:Create(plankClone, TweenInfo.new(0.4, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {Position = midCf.Position}):Play()
	tweenService:Create(plankClone, TweenInfo.new(0.2), {Transparency = 0}):Play()
	local originOrientation = plankClone.Orientation

	local start = tick()
	while tick() - start <= 0.5 do
		plankClone.Orientation = originOrientation + Vector3.new(math.random() * 6 - 3, math.random() * 6 - 3, math.random() * 6 - 3)
		wait()
	end

	tweenService:Create(plankClone, TweenInfo.new(0.1, Enum.EasingStyle.Cubic, Enum.EasingDirection.In), {CFrame = endCf}):Play()
	delay(0.1, function()
		smoke:Emit(60)
		sparks:Emit(30)
	end)
	wait(0.5)

	plank.Transparency = 0

end

return WoodenBarrierFX


Prompt:
-- Disconnect all handlers. Since we use a linked list it suffices to clear the
-- reference to the head handler.

Response:
function Signal.DisconnectAll(self: ClassType)
	self._handlerListHead = nil
end


Prompt:
--[[
    To quickly get pre-generated tables for player status models
]]

Response:
local PlayerStatusModel = {}

function PlayerStatusModel.generate(currentState)
	return {
		currentState = currentState
	}
end

function PlayerStatusModel.generateBot()
	return {
		isBot = true
	}
end

return PlayerStatusModel


Prompt: --Please keep my name in there. ;)

Response: bannedlist = { "someoneyouhate","noob"}--If you want someone not to be able to enter your place, put thier name in here.


Prompt:
--[[

	Ser is a serialization/deserialization utility module that is used
	by Knit to automatically serialize/deserialize values passing
	through remote functions and remote events.

	Ser.Classes = {
		[ClassName] = {
			Serialize = (value) -> serializedValue
			Deserialize = (value) => deserializedValue
		}
	}

	Ser.SerializeArgs(...)            -> table
	Ser.SerializeArgsAndUnpack(...)   -> Tuple
	Ser.DeserializeArgs(...)          -> table
	Ser.DeserializeArgsAndUnpack(...) -> Tuple
	Ser.Serialize(value: any)         -> any
	Ser.Deserialize(value: any)       -> any
	Ser.UnpackArgs(args: table)       -> Tuple

--]]

Response:
type Args = {
	n: number,
	[any]: any,
}

local Option = require(script.Parent.Option)

local Ser = {}

Ser.Classes = {
	Option = {
		Serialize = function(opt) return opt:Serialize() end;
		Deserialize = Option.Deserialize;
	};
}

function Ser.SerializeArgs(...: any): Args
	local args = table.pack(...)
	for i,arg in ipairs(args) do
		if type(arg) == "table" then
			local ser = Ser.Classes[arg.ClassName]
			if ser then
				args[i] = ser.Serialize(arg)
			end
		end
	end
	return args
end

function Ser.SerializeArgsAndUnpack(...: any): ...any
	local args = Ser.SerializeArgs(...)
	return table.unpack(args, 1, args.n)
end

function Ser.DeserializeArgs(...: any): Args
	local args = table.pack(...)
	for i,arg in ipairs(args) do
		if (type(arg) == "table") then
			local ser = Ser.Classes[arg.ClassName]
			if (ser) then
				args[i] = ser.Deserialize(arg)
			end
		end
	end
	return args
end

function Ser.DeserializeArgsAndUnpack(...: any): ...any
	local args = Ser.DeserializeArgs(...)
	return table.unpack(args, 1, args.n)
end

function Ser.Serialize(value: any): any
	if (type(value) == "table") then
		local ser = Ser.Classes[value.ClassName]
		if (ser) then
			value = ser.Serialize(value)
		end
	end
	return value
end

function Ser.Deserialize(value: any): any
	if (type(value) == "table") then
		local ser = Ser.Classes[value.ClassName]
		if (ser) then
			value = ser.Deserialize(value)
		end
	end
	return value
end

function Ser.UnpackArgs(args: Args): ...any
	return table.unpack(args, 1, args.n)
end

return Ser


Prompt:
--!strict
--[=[
	@function push
	@within Array

	@param array {T} -- The array to push an element to.
	@param ... ...T -- The elements to push.
	@return {T} -- The array with the pushed elements.

	Adds elements to the end of the array.

	#### Aliases

	`append`

	```lua
	local array = { 1, 2, 3 }

	local new = Push(array, 4, 5, 6) -- { 1, 2, 3, 4, 5, 6 }
	```
]=]

Response:
local function push<T>(array: { T }, ...: T): { T }
	local result = {}

	for index, value in ipairs(array) do
		table.insert(result, value)
	end

	for _, value in ipairs({ ... }) do
		table.insert(result, value)
	end

	return result
end

return push


Prompt: -- originalEndWaypoint is optional, causes the waypoint to tween from that position.

Response:
function ClickToMoveDisplay.CreatePathDisplay(wayPoints, originalEndWaypoint)
	createPathCount = createPathCount + 1
	local trailDots = createTrailDots(wayPoints, originalEndWaypoint)

	local function removePathBeforePoint(wayPointNumber)
		-- kill all trailDots before and at wayPointNumber
		for i = #trailDots, 1, -1 do
			local trailDot = trailDots[i]
			if trailDot.ClosestWayPoint <= wayPointNumber then
				trailDot:Destroy()
				trailDots[i] = nil
			else
				break
			end
		end
	end

	local reiszeTrailDotsUpdateName = "ClickToMoveResizeTrail" ..createPathCount
	local function resizeTrailDots()
		if #trailDots == 0 then
			RunService:UnbindFromRenderStep(reiszeTrailDotsUpdateName)
			return
		end
		local cameraPos = Workspace.CurrentCamera.CFrame.p
		for i = 1, #trailDots do
			local trailDotImage = trailDots[i].DisplayModel:FindFirstChild("TrailDotImage")
			if trailDotImage then
				local distanceToCamera = (trailDots[i].DisplayModel.Position - cameraPos).magnitude
				trailDotImage.Size = getTrailDotScale(distanceToCamera, TrailDotSize)
			end
		end
	end
	RunService:BindToRenderStep(reiszeTrailDotsUpdateName, Enum.RenderPriority.Camera.Value - 1, resizeTrailDots)

	local function removePath()
		removePathBeforePoint(#wayPoints)
	end

	return removePath, removePathBeforePoint
end

local lastFailureWaypoint = nil
function ClickToMoveDisplay.DisplayFailureWaypoint(position)
	if lastFailureWaypoint then
		lastFailureWaypoint:Hide()
	end
	local failureWaypoint = FailureWaypoint.new(position)
	lastFailureWaypoint = failureWaypoint
	coroutine.wrap(function()
		failureWaypoint:RunFailureTween()
		failureWaypoint:Destroy()
		failureWaypoint = nil
	end)()
end

function ClickToMoveDisplay.CreateEndWaypoint(position)
	return EndWaypoint.new(position)
end

function ClickToMoveDisplay.PlayFailureAnimation()
	local myHumanoid = findPlayerHumanoid()
	if myHumanoid then
		local animationTrack = getFailureAnimationTrack(myHumanoid)
		animationTrack:Play()
	end
end

function ClickToMoveDisplay.CancelFailureAnimation()
	if lastFailureAnimationTrack ~= nil and lastFailureAnimationTrack.IsPlaying then
		lastFailureAnimationTrack:Stop()
	end
end

function ClickToMoveDisplay.SetWaypointTexture(texture)
	TrailDotIcon = texture
	TrailDotTemplate, EndWaypointTemplate, FailureWaypointTemplate = CreateWaypointTemplates()
end

function ClickToMoveDisplay.GetWaypointTexture()
	return TrailDotIcon
end

function ClickToMoveDisplay.SetWaypointRadius(radius)
	TrailDotSize = Vector2.new(radius, radius)
	TrailDotTemplate, EndWaypointTemplate, FailureWaypointTemplate = CreateWaypointTemplates()
end

function ClickToMoveDisplay.GetWaypointRadius()
	return TrailDotSize.X
end

function ClickToMoveDisplay.SetEndWaypointTexture(texture)
	EndWaypointIcon = texture
	TrailDotTemplate, EndWaypointTemplate, FailureWaypointTemplate = CreateWaypointTemplates()
end

function ClickToMoveDisplay.GetEndWaypointTexture()
	return EndWaypointIcon
end

function ClickToMoveDisplay.SetWaypointsAlwaysOnTop(alwaysOnTop)
	WaypointsAlwaysOnTop = alwaysOnTop
	TrailDotTemplate, EndWaypointTemplate, FailureWaypointTemplate = CreateWaypointTemplates()
end

function ClickToMoveDisplay.GetWaypointsAlwaysOnTop()
	return WaypointsAlwaysOnTop
end

return ClickToMoveDisplay


Prompt: --Made by Luckymaxer

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

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

RbxUtility = LoadLibrary("RbxUtility")
Create = RbxUtility.Create

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

AnimationTracks = {}

Controls = {
	Forward = {
		Down = false,
		Keys = {Key = "w", ByteKey = 17}
	},
	Backward = {
		Down = false,
		Keys = {Key = "s", ByteKey = 18}
	},
	Left = {
		Down = false,
		Keys = {Key = "a", ByteKey = 20}
	},
	Right = {
		Down = false,
		Keys = {Key = "d", ByteKey = 19}
	}
}

Rate = (1 / 60)

Gravity = 196.20

Speed = {
	Acceleration = 20,
	Deceleration = 20,
	MovementSpeed = {Min = 35, Max = 35},
	TurnSpeed = {
		Speed = {Min = 3, Max = 3},
		TurnAlpha = 0.5,
		AlphaDampening = 0.2
	},
	Pitch = {Min = 40, Max = 40}
}

MaxSpeed = { --Maximum speed which the vehicle can move and turn at.
	Movement = Speed.MovementSpeed,
	Turn = Speed.TurnSpeed.Speed,
	Pitch = Speed.Pitch,
	Acceleration = Speed.Acceleration,
	Deceleration = Speed.Deceleration
}

CurrentSpeed = { --The speed which the vehicle is moving and turning at.
	Movement = 0,
	Turn = 0,
	Pitch = 0
}

ToolEquipped = false

function SetAnimation(mode, value)
	if mode == "PlayAnimation" and value and ToolEquipped and Humanoid then
		for i, v in pairs(AnimationTracks) do
			if v.Animation == value.Animation then
				v.AnimationTrack:Stop()
				table.remove(Animations, i)
			end
		end
		local AnimationTrack = Humanoid:LoadAnimation(value.Animation)
		table.insert(AnimationTracks, {Animation = value.Animation, AnimationTrack = AnimationTrack})
		AnimationTrack:Play(value.FadeTime, value.Weight, value.Speed)
	elseif mode == "StopAnimation" and value then
		for i, v in pairs(AnimationTracks) do
			if v.Animation == value.Animation then
				v.AnimationTrack:Stop(value.FadeTime)
				table.remove(Animations, i)
			end
		end
	end
end

function ThrustUpdater()
	Humanoid.WalkSpeed = 0
	Humanoid.AutoRotate = false
	Humanoid.PlatformStand = true

	if Controls.Forward.Down then --Handle acceleration
		CurrentSpeed.Pitch = math.min(MaxSpeed.Pitch.Max, (CurrentSpeed.Pitch + Speed.TurnSpeed.TurnAlpha))
	end
	if Controls.Backward.Down then --Handle deceleration, if speed is more than 0, decrease quicker.
		CurrentSpeed.Pitch = math.min(MaxSpeed.Pitch.Min, (CurrentSpeed.Pitch - Speed.TurnSpeed.TurnAlpha))
	end

	if Controls.Left.Down then --Handle left turn speed
		CurrentSpeed.Turn = math.min(MaxSpeed.Turn.Min, (CurrentSpeed.Turn + Speed.TurnSpeed.TurnAlpha))
	end
	if Controls.Right.Down then --Handle right turn speed
		CurrentSpeed.Turn = math.max(-MaxSpeed.Turn.Max, (CurrentSpeed.Turn - Speed.TurnSpeed.TurnAlpha))
	end
	if math.abs(CurrentSpeed.Turn) > Speed.TurnSpeed.AlphaDampening then
		CurrentSpeed.Turn = (CurrentSpeed.Turn - ((Speed.TurnSpeed.AlphaDampening) * (math.abs(CurrentSpeed.Turn) / CurrentSpeed.Turn)))
	else
		CurrentSpeed.Turn = 0
	end
	if math.abs(CurrentSpeed.Pitch) > Speed.TurnSpeed.AlphaDampening then
		CurrentSpeed.Pitch = (CurrentSpeed.Pitch - (Speed.TurnSpeed.AlphaDampening * (math.abs(CurrentSpeed.Pitch) / CurrentSpeed.Pitch)))
	else
		CurrentSpeed.Pitch = 0
	end
	local LeanAmount = (-CurrentSpeed.Turn * (math.pi / 6) / 1.5)
	local Direction = Torso.CFrame.lookVector
	local XZDirection = Vector3.new(Direction.X, 0, Direction.Z).Unit
	ThrustForce.velocity = (Direction * CurrentSpeed.Movement)
	local XZNormal = (CFrame.Angles(0, (math.pi / 2), 0) * XZDirection)
	if math.abs(Direction.Y) > 0.85 then
		RotationForce.angularvelocity = (TurnGyro.cframe * Vector3.new(0, CurrentSpeed.Turn, 0))
		CurrentSpeed.Pitch = 0
	elseif not Controls.Forward.Down and not Controls.Backward.Down and not Controls.Left.Down and not Controls.Right.Down then
		local TurnForce = (CurrentSpeed.Pitch + (math.sin(tick() * 4) * 3))
		RotationForce.angularvelocity = (TurnGyro.cframe * Vector3.new((TurnForce * XZNormal.X), CurrentSpeed.Turn, (TurnForce * XZNormal.Z)))
	else
		RotationForce.angularvelocity = (TurnGyro.cframe * Vector3.new((CurrentSpeed.Pitch * XZNormal.X), CurrentSpeed.Turn, (CurrentSpeed.Pitch * XZNormal.Z)))
	end
	TurnGyro.cframe = CFrame.Angles((LeanAmount * XZDirection.X), 0, (LeanAmount * XZDirection.Z))
	wait(Rate)
end

function SetUpMovement()
	for i, v in pairs(CurrentSpeed) do
		CurrentSpeed[i] = 0
	end
	CurrentSpeed.Movement = MaxSpeed.Movement.Max
	for i, v in pairs(Controls) do
		v.Down = false
	end
	SetAnimation("PlayAnimation", Animations.Sit)
	TurnGyro = Create("BodyGyro"){
		maxTorque = Vector3.new(math.huge, 0, math.huge),
		Parent = Torso,
	}
	ThrustForce = Create("BodyVelocity"){
		maxForce = Vector3.new(math.huge, math.huge, math.huge),
		velocity = Vector3.new(0, 0, 0),
		Parent = Torso,
	}
	RotationForce = Create("BodyAngularVelocity"){
		maxTorque = Vector3.new(math.huge, math.huge, math.huge),
		angularvelocity = Vector3.new(0, 0, 0),
		Parent = Torso,
	}
	Spawn(function()
		while CheckIfAlive() and TurnGyro.Parent and ThrustForce.Parent and RotationForce.Parent and ToolEquipped do
			ThrustUpdater()
			wait()
		end
	end)
end

function KeyPress(Key, Down)
	local ByteKey = string.byte(Key)
	for i, v in pairs(Controls) do
		if v.Keys.Key == Key or v.Keys.ByteKey == ByteKey then
			v.Down = Down
		end
	end
end

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

function Equipped(Mouse)
	Character = Tool.Parent
	Player = Players:GetPlayerFromCharacter(Character)
	Humanoid = Character:FindFirstChild("Humanoid")
	Torso = Character:FindFirstChild("Torso")
	if not CheckIfAlive() then
		return
	end
	ToolEquipped = true
	Mouse.KeyDown:connect(function(Key)
		KeyPress(Key, true)
	end)
	Mouse.KeyUp:connect(function(Key)
		KeyPress(Key, false)
	end)
	Spawn(SetUpMovement)
	Humanoid:ChangeState(Enum.HumanoidStateType.None)
end

function Unequipped()
	for i, v in pairs(Controls) do
		v.Down = false
	end
	for i, v in pairs(AnimationTracks) do
		if v and v.AnimationTrack then
			v.AnimationTrack:Stop()
		end
	end
	for i, v in pairs({TurnGyro, ThrustForce, RotationForce}) do
		if tostring(v) == "Connection" then
			v:disconnect()
		elseif type(v) == "userdata" and v.Parent then
			Debris:AddItem(v, 0)
		end
	end
	if CheckIfAlive() then
		Humanoid.WalkSpeed = 16
		Humanoid.AutoRotate = true
		Humanoid.PlatformStand = false
		Humanoid:ChangeState(Enum.HumanoidStateType.Freefall)
	end
	AnimationTracks = {}
	ToolEquipped = false
end

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


Prompt: -- initialize camera shaker object

Response:
local camShake = CameraShaker.new(Enum.RenderPriority.Camera.Value, function(shakeCf)
	camera.CFrame = camera.CFrame * shakeCf
end)
camShake:Start()

local CameraShake = {}

function CameraShake.ShakeOnce()
	if not tool:GetAttribute('CameraShake') then return end
	-- CameraShaker:ShakeOnce(magnitude, roughness [, fadeInTime, fadeOutTime, posInfluence, rotInfluence])
	camShake:ShakeOnce(5, 20 , 0, 1.5, Vector3.new(.5,.5,.5), Vector3.new())
end

function CameraShake.ShakeSustain()
	if not tool:GetAttribute('CameraShake') then return end
	camShake:ShakeSustain(CameraShaker.Presets.Earthquake)
end

function CameraShake.StopSustained()
	if not tool:GetAttribute('CameraShake') then return end
	camShake:StopSustained(1)
end

return CameraShake


Prompt: -- Wait for tool to load completely

Response:
while not (Support.GetDescendantCount(Tool) >= TotalCount) do
	wait(0.1);
end;


Prompt: -- Instancing method caching

Response:
local vec3 = Vector3.new
local vec2 = Vector2.new
local cframe = CFrame.new
local angles = CFrame.Angles


Prompt:
--[[
    Creates a new controller associated with the specified vehicle.
]]

Response:
function VehicleSoundComponent.new(model, controller)
	local component = {
		model = model,
		controller = controller
	}
	setmetatable(component, {__index = VehicleSoundComponent})

	component:setup()

	return component
end


Prompt:
-- Updated 10/14/2014 - Updated to 1.0.3
--- Now handles joints semi-acceptably. May be rather hacky with some joints. :/

Response:
local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).

local function CallOnChildren(Instance, FunctionToCall)
	-- Calls a function on each of the children of a certain object, using recursion.

	FunctionToCall(Instance)

	for _, Child in next, Instance:GetChildren() do
		CallOnChildren(Child, FunctionToCall)
	end
end

local function GetNearestParent(Instance, ClassName)
	-- Returns the nearest parent of a certain class, or returns nil

	local Ancestor = Instance
	repeat
		Ancestor = Ancestor.Parent
		if Ancestor == nil then
			return nil
		end
	until Ancestor:IsA(ClassName)

	return Ancestor
end

local function GetBricks(StartInstance)
	local List = {}

	-- if StartInstance:IsA("BasePart") then
	-- 	List[#List+1] = StartInstance
	-- end

	CallOnChildren(StartInstance, function(Item)
		if Item:IsA("BasePart") then
			List[#List+1] = Item;
		end
	end)

	return List
end

local function Modify(Instance, Values)
	-- Modifies an Instance by using a table.

	assert(type(Values) == "table", "Values is not a table");

	for Index, Value in next, Values do
		if type(Index) == "number" then
			Value.Parent = Instance
		else
			Instance[Index] = Value
		end
	end
	return Instance
end

local function Make(ClassType, Properties)
	-- Using a syntax hack to create a nice way to Make new items.

	return Modify(Instance.new(ClassType), Properties)
end

local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}

local function HasWheelJoint(Part)
	for _, SurfaceName in pairs(Surfaces) do
		for _, HingSurfaceName in pairs(HingSurfaces) do
			if Part[SurfaceName].Name == HingSurfaceName then
				return true
			end
		end
	end

	return false
end

local function ShouldBreakJoints(Part)
	--- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
	--  definitely some edge cases.

	if NEVER_BREAK_JOINTS then
		return false
	end

	if HasWheelJoint(Part) then
		return false
	end

	local Connected = Part:GetConnectedParts()

	if #Connected == 1 then
		return false
	end

	for _, Item in pairs(Connected) do
		if HasWheelJoint(Item) then
			return false
		elseif not Item:IsDescendantOf(script.Parent) then
			return false
		end
	end

	return true
end

local function WeldTogether(Part0, Part1, JointType, WeldParent)
	--- Weld's 2 parts together
	-- @param Part0 The first part
	-- @param Part1 The second part (Dependent part most of the time).
	-- @param [JointType] The type of joint. Defaults to weld.
	-- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
	-- @return The weld created.

	JointType = JointType or "Weld"
	local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")

	local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
	Modify(NewWeld, {
		Name = "qCFrameWeldThingy";
		Part0  = Part0;
		Part1  = Part1;
		C0     = CFrame.new();--Part0.CFrame:inverse();
		C1     = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
		Parent = Part1;
	})

	if not RelativeValue then
		RelativeValue = Make("CFrameValue", {
			Parent     = Part1;
			Name       = "qRelativeCFrameWeldValue";
			Archivable = true;
			Value      = NewWeld.C1;
		})
	end

	return NewWeld
end

local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
	-- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
	-- @param MainPart The part to weld the model to (can be in the model).
	-- @param [JointType] The type of joint. Defaults to weld.
	-- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.

	for _, Part in pairs(Parts) do
		if ShouldBreakJoints(Part) then
			Part:BreakJoints()
		end
	end

	for _, Part in pairs(Parts) do
		if Part ~= MainPart then
			WeldTogether(MainPart, Part, JointType, MainPart)
		end
	end

	if not DoNotUnanchor then
		for _, Part in pairs(Parts) do
			Part.Anchored = false
		end
		MainPart.Anchored = false
	end
end

local function PerfectionWeld()
	local Tool = GetNearestParent(script, "Tool")

	local Parts = GetBricks(script.Parent)
	local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]

	if PrimaryPart then
		WeldParts(Parts, PrimaryPart, "Weld", false)
	else
		warn("qWeld - Unable to weld part")
	end

	return Tool
end

local Tool = PerfectionWeld()

if Tool and script.ClassName == "Script" then
	--- Don't bother with local scripts

	script.Parent.AncestryChanged:connect(function()
		PerfectionWeld()
	end)
end


Prompt:
-- Helper function to lazily instantiate a controller if it does not yet exist,
-- disable the active controller if it is different from the on being switched to,
-- and then enable the requested controller. The argument to this function must be
-- a reference to one of the control modules, i.e. Keyboard, Gamepad, etc.

Response:
function ControlModule:SwitchToController(controlModule)
	if not controlModule then
		if self.activeController then
			self.activeController:Enable(false)
		end
		self.activeController = nil
		self.activeControlModule = nil
	else
		if not self.controllers[controlModule] then
			self.controllers[controlModule] = controlModule.new(CONTROL_ACTION_PRIORITY)
		end

		if self.activeController ~= self.controllers[controlModule] then
			if self.activeController then
				self.activeController:Enable(false)
			end
			self.activeController = self.controllers[controlModule]
			self.activeControlModule = controlModule -- Only used to check if controller switch is necessary
			if self.touchControlFrame then
				self.activeController:Enable(true, self.touchControlFrame)
			else
				if self.activeControlModule == ClickToMove then
					-- For ClickToMove, when it is the player's choice, we also enable the full keyboard controls.
					-- When the developer is forcing click to move, the most keyboard controls (WASD) are not available, only spacebar to jump.
					self.activeController:Enable(true, Players.LocalPlayer.DevComputerMovementMode == Enum.DevComputerMovementMode.UserChoice)
				else
					self.activeController:Enable(true)
				end
			end
			if self.touchControlFrame and (self.activeControlModule == TouchThumbpad
									or self.activeControlModule == TouchThumbstick
									or self.activeControlModule == ClickToMove
									or self.activeControlModule == DynamicThumbstick) then
				if not self.controllers[TouchJump] then
					self.controllers[TouchJump] = TouchJump.new()
				end
				self.touchJumpController = self.controllers[TouchJump]
				self.touchJumpController:Enable(true, self.touchControlFrame)
			else
				if self.touchJumpController then
					self.touchJumpController:Enable(false)
				end
			end
		end
	end
end

function ControlModule:OnLastInputTypeChanged(newLastInputType)
	if lastInputType == newLastInputType then
		warn("LastInputType Change listener called with current type.")
	end
	lastInputType = newLastInputType

	if lastInputType == Enum.UserInputType.Touch then
		-- TODO: Check if touch module already active
		local touchModule, success = self:SelectTouchModule()
		if success then
			while not self.touchControlFrame do
				wait()
			end
			self:SwitchToController(touchModule)
		end
	elseif computerInputTypeToModuleMap[lastInputType] ~= nil then
		local computerModule = self:SelectComputerMovementModule()
		if computerModule then
			self:SwitchToController(computerModule)
		end
	end
end


Prompt:
--[[
	Given a Model in 3D space, this function figures out how far the camera
	has to be pushed back to fit the model within the viewport.

	Check out this great video demonstrating the implementation:
	https://youtu.be/2J-2v_UqNDw
]]

Response:
local function getDepthToFitObject(fov: number, instance: Instance)
	local size: Vector3

	if instance:IsA("Model") then
		local _, boxSize = instance:GetBoundingBox()
		size = boxSize
	elseif instance:IsA("BasePart") then
		size = instance.Size
	else
		local part = instance:FindFirstChildWhichIsA("BasePart")
		size = part.Size
	end

	local sizeY = math.abs(size.Y)
	local sizeZ = math.abs(size.Z)

	return (sizeY / (math.tan(math.rad(fov / 2)) * 2)) + (sizeZ / 2)
end

local defaultProps = {
	size = UDim2.fromScale(1, 1),
	previewRotationSpeed = 15,
	rotation = 120,

	zoomRange = NumberRange.new(-DEPTH_PADDING, 5), -- studs
	zoomIncrement = 2.5, -- studs

	-- Mocks
	spring = Otter.spring,
	UserInputService = UserInputService,
	RunService = RunService,
}

export type Props = typeof(defaultProps) & {
	itemInfo: types.ItemInfo,
	previewMode: string,

	size: UDim2?,
	previewRotationSpeed: number?,
	rotation: number?,
	previewAvatar: Model?,

	UserInputService: UserInputService,
	RunService: RunService,
}

local ItemViewport = Roact.Component:extend("ItemViewport")

ItemViewport.defaultProps = defaultProps

function ItemViewport:init()
	self.isUserRotating = false
	self.isUserPinching = false

	self.zoomOffset = 0
	self.zoomMotor = Otter.createSingleMotor(self.zoomOffset)
	self.zoomMotor:onStep(function(value: number)
		self.zoomOffset = value
	end)

	self.rotation = self.props.rotation

	self.viewportCamera = Instance.new("Camera")
	self.lastViewportInputPosition = Vector3.new()
	self.viewportRef = Roact.createRef()

	self.heartbeatFunction = function(delta: number)
		local viewport: ViewportFrame = self.viewportRef:getValue()
		local viewportCamera: Camera = self.viewportCamera
		local viewportObject = viewport and viewport:FindFirstChildWhichIsA("Instance")

		if not viewportObject then
			return
		end

		local rotationSpeed = self.props.previewRotationSpeed
		if not self.isUserRotating then
			rotationSpeed = rotationSpeed * 0.95 + rotationSpeed * 0.05
			self.rotation = (self.rotation + delta * rotationSpeed) % 360
		end

		local props: Props = self.props
		local rotation = CFrame.Angles(0, math.rad(self.rotation), 0)
		local position = getInstanceCenter(viewportObject)
		local depth = getDepthToFitObject(viewportCamera.FieldOfView, viewportObject)
		depth = math.clamp(depth, props.zoomRange.Min, props.zoomRange.Max)

		viewportCamera.CFrame = CFrame.new(position)
			* rotation
			* CFrame.new(0, 0, depth + DEPTH_PADDING + self.zoomOffset)
	end

	self.zoom = function(direction: number)
		local props: Props = self.props
		local goal =
			math.clamp(self.zoomOffset - (props.zoomIncrement * direction), props.zoomRange.Min, props.zoomRange.Max)

		self.zoomMotor:setGoal(props.spring(goal, constants.Springs.Zippy))
	end

	self.inputBegan = function(_, input: InputObject)
		if input.UserInputType == Enum.UserInputType.MouseWheel then
			self.zoom(input.Position.Z)
		end

		if self.isUserPinching then
			return
		end

		if
			input.UserInputType == Enum.UserInputType.MouseButton1
			or input.UserInputType == Enum.UserInputType.Touch
		then
			self.isUserRotating = true

			self:setState({ viewportInput = true })
			self.lastViewportInputPosition = input.Position
		end
	end

	self.inputEnded = function(_rbx, input: InputObject)
		if self.isUserRotating then
			self.isUserRotating = false

			if
				input.UserInputType == Enum.UserInputType.MouseButton1
				or input.UserInputType == Enum.UserInputType.Touch
			then
				self:setState({ viewportInput = false })
			end
		end
	end

	self.inputChanged = function(_rbx, input: InputObject)
		if input.UserInputType == Enum.UserInputType.MouseWheel then
			self.zoom(input.Position.Z)
		end

		if self.isUserRotating and not self.isUserPinching then
			if
				input.UserInputType == Enum.UserInputType.MouseMovement
				or input.UserInputType == Enum.UserInputType.Touch
			then
				local delta = input.Position - self.lastViewportInputPosition -- input.Delta doesn't seem to work
				self.lastViewportInputPosition = input.Position
				self.rotation = self.rotation - delta.X
			end
		end
	end

	local lastPinchDistance: number
	self.touchPinch = function(_rbx, touchPositions: { Vector2 }, _scale, _velocity, state: Enum.UserInputState)
		if not touchPositions[2] or state == Enum.UserInputState.End then
			self.isUserPinching = false
			return
		end

		self.isUserPinching = true

		local pinchDistance = (touchPositions[1] - touchPositions[2]).Magnitude

		if state == Enum.UserInputState.Change then
			local props: Props = self.props
			local pinchDelta = pinchDistance - lastPinchDistance
			local goal = self.zoomOffset - (props.zoomIncrement * pinchDelta * PINCH_DELTA_TO_ZOOM_DELTA)

			self.zoomOffset = math.clamp(goal, props.zoomRange.Min, props.zoomRange.Max)
		end

		lastPinchDistance = pinchDistance
	end

	self.updateViewportItem = function()
		local props: Props = self.props
		local viewport: ViewportFrame = self.viewportRef:getValue()

		viewport:ClearAllChildren()

		if not props.itemInfo then
			return
		end

		if props.previewMode == enums.PreviewModes.Object then
			if props.itemInfo.viewportObject then
				local clone = props.itemInfo.viewportObject:Clone()
				clone.Parent = viewport
			else
				warn("Merch booth item preview: could not find item viewport object")
			end
		else
			if props.previewAvatar then
				local clone = props.previewAvatar:Clone()
				clone.Parent = viewport
			else
				warn("Merch booth item preview: could not find preview avatar")
			end
		end
	end
end

function ItemViewport:render()
	return Roact.createElement("ViewportFrame", {
		Active = true,
		LayoutOrder = self.props.LayoutOrder,
		Size = self.props.size,
		BackgroundTransparency = 1,
		CurrentCamera = self.viewportCamera,

		[Roact.Event.InputBegan] = self.inputBegan,
		[Roact.Event.InputEnded] = self.inputEnded,
		[Roact.Event.InputChanged] = self.inputChanged,
		[Roact.Event.TouchPinch] = self.touchPinch,
		[Roact.Ref] = self.viewportRef,
	}, {
		HeartbeatEventConnection = Roact.createElement(ExternalEventConnection, {
			event = self.props.RunService.Heartbeat,
			callback = self.heartbeatFunction,
		}),
	})
end

function ItemViewport:didMount()
	self.updateViewportItem()
end

function ItemViewport:didUpdate(previousProps: Props)
	local props: Props = self.props
	if
		previousProps.itemInfo ~= props.itemInfo
		or previousProps.previewMode ~= props.previewMode
		or props.previewAvatar ~= previousProps.previewAvatar
	then
		self.updateViewportItem()
	end
end

return ItemViewport


Prompt:
--[=[
	Constructs a new ClassName.

	```lua

	```

	@class ClassName
]=]

Response:
local class = {} do

end


Prompt:
--[[
	Create a copy of a list doing a combination filter and map.

	If callback returns nil for any item, it is considered filtered from the
	list. Any other value is considered the result of the 'map' operation.
]]

Response:
function Functional.FilterMap(list, callback)
	local new = {}

	for key = 1, #list do
		local value = list[key]
		local result = callback(value, key)

		if result ~= nil then
			table.insert(new, result)
		end
	end

	return new
end


Prompt:
--[[
  ___            __   _           _   _              __  __   _           _
 |_ _|  _ __    / _| (_)  _ __   (_) | |_    ___    |  \/  | (_)  _ __   (_)  _ __     __ _
  | |  | '_ \  | |_  | | | '_ \  | | | __|  / _ \   | |\/| | | | | '_ \  | | | '_ \   / _` |
  | |  | | | | |  _| | | | | | | | | | |_  |  __/   | |  | | | | | | | | | | | | | | | (_| |
 |___| |_| |_| |_|   |_| |_| |_| |_|  \__|  \___|   |_|  |_| |_| |_| |_| |_| |_| |_|  \__, |
   ____                                _  __  _   _
  / ___|   __ _   _ __ ___     ___    | |/ / (_) | |_
 | |  _   / _` | | '_ ` _ \   / _ \   | ' /  | | | __|
 | |_| | | (_| | | | | | | | |  __/   | . \  | | | |_
  \____|  \__,_| |_| |_| |_|  \___|   |_|\_\ |_|  \__|
                                                                                |___/
 ____  _  _    ____  ____  ____  ____  ____    __      __
(  _ \( \/ )  (  _ \( ___)(  _ \( ___)(_   )  /__\    /__\
 ) _ < \  /    ) _ < )__)  )   / )__)  / /_  /(__)\  /(__)\
(____/ (__)   (____/(____)(_)\_)(____)(____)(__)(__)(__)(__) V4

 Based on the popular mining game Azure Mines
 https://www.roblox.com/games/428114181/Azure-Mines/

 GUIDED VIDEO TUTORIAL: 🎥 youtube.com/watch?v=_wBfwupqmt8
 ^ (Made for v2. The command step is slightly different. If you need help, check
    the description of the video for resources. Make sure you read and follow the
    set-up instructions below very carefully.)

 Contained within this kit is everything you need to set up a fully-functional infinite
 mining game within minutes. Follow these instructions and you'll be set to go in no time!
 Watch out for new versions of the kit and join our Infinite Mining Games community for
 announcements, news, help, and to share your creations.

 If you enjoy the kit please consider leaving a 👍 Thumbs Up and ⭐ Favorite the model
 to help others find it. If you are a developer, please consider releasing your own old
 projects to the public domain as kits. It could make an enormous impact on the life of
 a young creator who discovers it.

 https://www.roblox.com/library/4920625917/Infinite-Mining-Game-Kit-by-berezaa

 SET-UP INSTRUCTIONS

 STEP #1:

	 The Infinite Mining Game Kit expects everything to be at a certain position. Enter the
	 following command in your "Run a command" output at the bottom of Roblox Studio:

	 -->
		 workspace["Infinite Mining Game Kit v4 by berezaa"]:SetPrimaryPartCFrame(
		 CFrame.new(86.3270645, 5013.8042, 74.279068, -0.258819073, 0, 0.965925813,
		 0, 1, 0, -0.965925813, 0, -0.258819073))

	 You'll notice that everything is now gone. Point your camera directly upwards and you'll
	 see the map. You can fly your camera towards it or teleport there directly using the command:

	 -->
		 workspace.CurrentCamera.CFrame = CFrame.new(85, 5030, 75)

 STEP #2:

	At this point, everything is positioned where it will be in the real game and all of the
	ores and building components are laid out in the workspace. You may want to save a copy
	of the place so you can easily edit the ores and building components before setting up
	the game with the following steps.

 STEP #3:

	Re-parent the contents of each folder into the game service of the same name.

	For example, open the kit, right-click the folder named ReplicatedStorage and
	"Select Children". Then right-click again and "Cut". Find the real ReplicatedStorage
	service in your Explorer, right-click and "Paste Into"

	Be careful with the Workspace folder, as using "Cut" and "Paste Into" may cause
	the parts to be re-positioned, which will break things. Instead, right-click the
	Workspace folder and "Select Children". Then use your mouse to drag all of the
	selected children into the real workspace (Planet earth icon). This should prevent
	anything from being automatically displaced by Roblox. It may be a good idea to
	do the Workspace folder last.

	NOTE: For the StarterPlayer folder, you will need to follow the instructions above
	for both of the StarterPlayerScripts and StarterCharacterScripts folders individually.
	Roblox has special folders for this, so make sure you are moving the contents from
	those folders into the correct Roblox folders. If the game is stuck on a dark screen
	when you are trying to play, messing up this step is the most common reason why.

 STEP #4:

	Make sure your game is published. Go to "File -> Publish to Roblox" to confirm. If the
	option is greyed out that means you are not published. Use "File -> Publish to Roblox as"
	to create a new place for your mining game.

	Next go to "Home -> Game Settings -> Options" and turn on "Enable Studio Access to API
	Services." You may also go to "Game Settings -> Avatar" and set "Avatar Type" to "R6"
	and "Collision" to "Inner Box". You should know that changing the avatar settings is
	not required for the kit to work, but the kit is designed with classic avatars in mind.

    NOTE: If you are not able to test in Studio, you may need to visit the "Create" tab on
	the Roblox website and go to "Game Settings" of the new game you have created. Once you
	are there, toggle the "Allow studio access to API" setting. Also note that "game settings"
	are different from "place settings".

	Finally, "File -> Publish to Roblox" one more time.

 And you're done! Go to "Test -> Play" to try out the game in Roblox Studio, or go to
 the Roblox website and play your game there. If you have any questions, feel free to PM
 berezaa on Roblox. Please follow me @berezaagames for dev content

 Once you've made sure everything works, you can extend the functionality of the game by
 adding new levels of base machines, new pickaxes, new ores and more without any scripting
 required. Have fun!

 Want to try making a more advanced game? Miner's Haven's full source file is available for
 use. Get it here:

 devforum.roblox.com/t/miners-haven-open-sourced/350767

]]

Response: return "the favor"


Prompt: --//Shifting//-

Response:
if key == "1" then
	carSeat.Wheels.FR.Spring.Stiffness = 8000
 	carSeat.Wheels.FL.Spring.Stiffness = 8000
	carSeat.Wheels.RR.Spring.Stiffness = 8000
	carSeat.Wheels.RL.Spring.Stiffness = 8000
	carSeat.Wheels.FR.Spring.MinLength = 1.6
	carSeat.Wheels.FL.Spring.MinLength = 1.6
	carSeat.Wheels.RR.Spring.MinLength = 1.6
	carSeat.Wheels.RL.Spring.MinLength = 1.6
	car.DriveSeat.Air:Play()
	wait(0.1)
	carSeat.Wheels.FR.Spring.Stiffness = 7000
 	carSeat.Wheels.FL.Spring.Stiffness = 7000
	carSeat.Wheels.RR.Spring.Stiffness = 7000
	carSeat.Wheels.RL.Spring.Stiffness = 7000
	carSeat.Wheels.FR.Spring.MinLength = 1.575
	carSeat.Wheels.FL.Spring.MinLength = 1.575
	carSeat.Wheels.RR.Spring.MinLength = 1.575
	carSeat.Wheels.RL.Spring.MinLength = 1.575
	wait(0.1)
	carSeat.Wheels.FR.Spring.Stiffness = 6000
 	carSeat.Wheels.FL.Spring.Stiffness = 6000
	carSeat.Wheels.RR.Spring.Stiffness = 6000
	carSeat.Wheels.RL.Spring.Stiffness = 6000
	carSeat.Wheels.FR.Spring.MinLength = 1.560
	carSeat.Wheels.FL.Spring.MinLength = 1.560
	carSeat.Wheels.RR.Spring.MinLength = 1.560
	carSeat.Wheels.RL.Spring.MinLength = 1.560
	wait(0.1)
	carSeat.Wheels.FR.Spring.Stiffness = 5000
 	carSeat.Wheels.FL.Spring.Stiffness = 5000
	carSeat.Wheels.RR.Spring.Stiffness = 5000
	carSeat.Wheels.RL.Spring.Stiffness = 5000
	carSeat.Wheels.FR.Spring.MinLength = 1.545
	carSeat.Wheels.FL.Spring.MinLength = 1.545
	carSeat.Wheels.RR.Spring.MinLength = 1.545
	carSeat.Wheels.RL.Spring.MinLength = 1.545
	car.DriveSeat.Air:Stop()
elseif key == "2" then
	car.DriveSeat.Air:Play()
	carSeat.Wheels.FR.Spring.Stiffness = 5000
 	carSeat.Wheels.FL.Spring.Stiffness = 5000
	carSeat.Wheels.RR.Spring.Stiffness = 5000
	carSeat.Wheels.RL.Spring.Stiffness = 5000
	carSeat.Wheels.FR.Spring.MinLength = 1.545
	carSeat.Wheels.FL.Spring.MinLength = 1.545
	carSeat.Wheels.RR.Spring.MinLength = 1.545
	carSeat.Wheels.RL.Spring.MinLength = 1.545
	wait(0.1)
	carSeat.Wheels.FR.Spring.Stiffness = 6000
 	carSeat.Wheels.FL.Spring.Stiffness = 6000
	carSeat.Wheels.RR.Spring.Stiffness = 6000
	carSeat.Wheels.RL.Spring.Stiffness = 6000
	carSeat.Wheels.FR.Spring.MinLength = 1.560
	carSeat.Wheels.FL.Spring.MinLength = 1.560
	carSeat.Wheels.RR.Spring.MinLength = 1.560
	carSeat.Wheels.RL.Spring.MinLength = 1.560
	wait(0.1)
	carSeat.Wheels.FR.Spring.Stiffness = 7000
	carSeat.Wheels.FL.Spring.Stiffness = 7000
	carSeat.Wheels.RR.Spring.Stiffness = 7000
	carSeat.Wheels.RL.Spring.Stiffness = 7000
	carSeat.Wheels.FR.Spring.MinLength = 1.575
	carSeat.Wheels.FL.Spring.MinLength = 1.575
	carSeat.Wheels.RR.Spring.MinLength = 1.575
	carSeat.Wheels.RL.Spring.MinLength = 1.575
	wait(0.1)
	carSeat.Wheels.FR.Spring.Stiffness = 8000
	carSeat.Wheels.FL.Spring.Stiffness = 8000
	carSeat.Wheels.RR.Spring.Stiffness = 8000
	carSeat.Wheels.RL.Spring.Stiffness = 8000
	carSeat.Wheels.FR.Spring.MinLength = 1.6
	carSeat.Wheels.FL.Spring.MinLength = 1.6
	carSeat.Wheels.RR.Spring.MinLength = 1.6
	carSeat.Wheels.RL.Spring.MinLength = 1.6
	car.DriveSeat.Air:Stop()
	end
end)


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


Prompt: --Put in ServerScriptService

Response:
game.Players.PlayerAdded:connect(function(player)
	player.CharacterAdded:connect(function(character)
		script.RagdollClient:Clone().Parent = character

		character:WaitForChild("Humanoid").Died:connect(function()
			character.UpperTorso:SetNetworkOwner(player)
		end)
	end)
end)


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

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

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

return Package


Prompt:
--			game.Workspace.Points:ClearAllChildren()
--			local ps = path:GetPointCoordinates()
--			for _, point in pairs(ps) do
--				local part = Instance.new("Part", game.Workspace.Points)
--				part.CanCollide = false
--				part.Anchored = true
--				part.FormFactor = Enum.FormFactor.Custom
--				part.Size = Vector3.new(1,1,1)
--				part.Position = point
--			end

Response:
			currentPointIndex = 1
			lastTargetPos = target
		end

		if path then
			local points = path:GetPointCoordinates()
			if currentPointIndex < #points then
				local currentPoint = points[currentPointIndex]
				if not character:FindFirstChild("HumanoidRootPart") then return end
				local distance = (character.HumanoidRootPart.Position - currentPoint).magnitude
				if distance < NextPointThreshold then
					currentPointIndex = currentPointIndex + 1
				end

				character.Humanoid:MoveTo(points[currentPointIndex])
				if points[currentPointIndex].Y - character.HumanoidRootPart.Position.Y > JumpThreshold then
					character.Humanoid.Jump = true
				end
			else
				character.Humanoid:MoveTo(target)
			end
		end
	end

	return this
end
return PathfindingUtility


Prompt: -- Variables (best not to touch these!)

Response:
local button = script.Parent
local car = script.Parent.Parent.Car.Value
local sound = script.Parent.Start
sound.Parent = car.DriveSeat -- What brick the start sound is playing from.
button.MouseButton1Click:connect(function() -- Event when the button is clicked
	if script.Parent.Text == "Engine: Off" then -- If the text says it's off then..
		sound:Play() -- Startup sound plays..
		wait(1.2) -- For realism. Okay?
		script.Parent.Parent.IsOn.Value = true -- The car is is on, or in other words, start up the car.
		button.Text = "Engine: On"  -- You don't really need this, but I would keep it.
	else -- If it's on then when you click the button,
		script.Parent.Parent.IsOn.Value = false -- The car is turned off.
		button.Text = "Engine: Off"
	end -- Don't touch this.
end) -- And don't touch this either.


Prompt:
--[[
 * Used to print values in error messages.
 ]]

Response:
local function inspect(value, options: InspectOptions?): string
	local inspectOptions: InspectOptions = options or { depth = DEFAULT_RECURSIVE_DEPTH }
	local depth = inspectOptions.depth or DEFAULT_RECURSIVE_DEPTH
	inspectOptions.depth = if depth >= 0 then depth else DEFAULT_RECURSIVE_DEPTH
	return formatValue(value, {}, inspectOptions :: FormatOptions)
end

local function isIndexKey(k, contiguousLength)
	return type(k) == "number"
		and k <= contiguousLength -- nothing out of bounds
		and 1 <= k -- nothing illegal for array indices
		and math.floor(k) == k -- no float keys
end

local function getTableLength(tbl)
	local length = 1
	local value = rawget(tbl, length)
	while value ~= nil do
		length += 1
		value = rawget(tbl, length)
	end
	return length - 1
end

local function sortKeysForPrinting(a: any, b)
	local typeofA = type(a)
	local typeofB = type(b)

	-- strings and numbers are sorted numerically/alphabetically
	if typeofA == typeofB and (typeofA == "number" or typeofA == "string") then
		return a < b
	end

	-- sort the rest by type name
	return typeofA < typeofB
end

local function rawpairs(t)
	return next, t, nil
end

local function getFragmentedKeys(tbl)
	local keys = {}
	local keysLength = 0
	local tableLength = getTableLength(tbl)
	for key, _ in rawpairs(tbl) do
		if not isIndexKey(key, tableLength) then
			keysLength = keysLength + 1
			keys[keysLength] = key
		end
	end
	table.sort(keys, sortKeysForPrinting)
	return keys, keysLength, tableLength
end

function formatValue(value, seenValues, options: FormatOptions)
	local valueType = typeof(value)
	if valueType == "string" then
		return HttpService:JSONEncode(value)
		-- deviation: format numbers like in JS
	elseif valueType == "number" then
		if value ~= value then
			return "NaN"
		elseif value == math.huge then
			return "Infinity"
		elseif value == -math.huge then
			return "-Infinity"
		else
			return tostring(value)
		end
	elseif valueType == "function" then
		local result = "[function"
		local functionName = debug.info(value :: (any) -> any, "n")
		if functionName ~= nil and functionName ~= "" then
			result ..= " " .. functionName
		end
		return result .. "]"
	elseif valueType == "table" then
		-- ROBLOX TODO: parameterize inspect with the library-specific NULL sentinel. maybe function generics?
		-- if value == NULL then
		-- 	return 'null'
		-- end
		return formatObjectValue(value, seenValues, options)
	else
		return tostring(value)
	end
end

function formatObjectValue(value, previouslySeenValues, options: FormatOptions)
	if table.find(previouslySeenValues, value) ~= nil then
		return "[Circular]"
	end

	local seenValues = { unpack(previouslySeenValues) }
	table.insert(seenValues, value)

	if typeof(value.toJSON) == "function" then
		local jsonValue = value:toJSON(value)

		if jsonValue ~= value then
			if typeof(jsonValue) == "string" then
				return jsonValue
			else
				return formatValue(jsonValue, seenValues, options)
			end
		end
	elseif Array.isArray(value) then
		return formatArray(value, seenValues, options)
	end

	return formatObject(value, seenValues, options)
end

function formatObject(object, seenValues, options: FormatOptions)
	local result = ""
	local mt = getmetatable(object)
	if mt and rawget(mt, "__tostring") then
		return tostring(object)
	end

	local fragmentedKeys, fragmentedKeysLength, keysLength = getFragmentedKeys(object)

	if keysLength == 0 and fragmentedKeysLength == 0 then
		result ..= "{}"
		return result
	end
	if #seenValues > options.depth then
		result ..= "[" .. getObjectTag(object) .. "]"
		return result
	end

	local properties = {}
	for i = 1, keysLength do
		local value = formatValue(object[i], seenValues, options)

		table.insert(properties, value)
	end

	for i = 1, fragmentedKeysLength do
		local key = fragmentedKeys[i]
		local value = formatValue(object[key], seenValues, options)

		table.insert(properties, key .. ": " .. value)
	end

	result ..= "{ " .. table.concat(properties, ", ") .. " }"
	return result
end

function formatArray(array: Array<any>, seenValues: Array<any>, options: FormatOptions): string
	local length = #array
	if length == 0 then
		return "[]"
	end
	if #seenValues > options.depth then
		return "[Array]"
	end

	local len = math.min(MAX_ARRAY_LENGTH, length)
	local remaining = length - len
	local items = {}

	for i = 1, len do
		items[i] = (formatValue(array[i], seenValues, options))
	end

	if remaining == 1 then
		table.insert(items, "... 1 more item")
	elseif remaining > 1 then
		table.insert(items, ("... %s more items"):format(tostring(remaining)))
	end

	return "[" .. table.concat(items, ", ") .. "]"
end

function getObjectTag(_object): string
	-- local tag = Object.prototype.toString
	-- 	.call(object)
	-- 	.replace("")
	-- 	.replace("")

	-- if tag == "Object" and typeof(object.constructor) == "function" then
	-- 	local name = object.constructor.name

	-- 	if typeof(name) == "string" and name ~= "" then
	-- 		return name
	-- 	end
	-- end

	-- return tag
	return "Object"
end

return inspect


Prompt: -- 2

Response:
module.SortAggregation.PastWeek = 3
module.SortAggregation.PastMonth = 4
module.SortAggregation.AllTime = 5

module.SortType = {}
module.SortType.Relevance = 0
module.SortType.Favorited = 1
module.SortType.Sales = 2
module.SortType.Updated = 3
module.SortType.PriceAsc = 4
module.SortType.PriceDesc = 5

module.Subcategory = {}
module.Subcategory.Featured = 0
module.Subcategory.All = 1
module.Subcategory.Collectibles = 2
module.Subcategory.Clothing = 3
module.Subcategory.BodyParts = 4
module.Subcategory.Gear = 5


Response:
local WaitTime = 1	-- Change this to the amount of time it takes for the button to re-enable.
local modelname = "Tren"	-- If your model is not named this, then make the purple words the same name as the model!


Prompt:
--// This section of code waits until all of the necessary RemoteEvents are found in EventFolder.
--// I have to do some weird stuff since people could potentially already have pre-existing
--// things in a folder with the same name, and they may have different class types.
--// I do the useEvents thing and set EventFolder to useEvents so I can have a pseudo folder that
--// the rest of the code can interface with and have the guarantee that the RemoteEvents they want
--// exist with their desired names.

Response:
local FILTER_MESSAGE_TIMEOUT = 60

local RunService = game:GetService("RunService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Chat = game:GetService("Chat")
local StarterGui = game:GetService("StarterGui")

local DefaultChatSystemChatEvents = ReplicatedStorage:WaitForChild("DefaultChatSystemChatEvents")
local EventFolder = ReplicatedStorage:WaitForChild("DefaultChatSystemChatEvents")
local clientChatModules = Chat:WaitForChild("ClientChatModules")
local ChatConstants = require(clientChatModules:WaitForChild("ChatConstants"))
local ChatSettings = require(clientChatModules:WaitForChild("ChatSettings"))
local messageCreatorModules = clientChatModules:WaitForChild("MessageCreatorModules")
local MessageCreatorUtil = require(messageCreatorModules:WaitForChild("Util"))

local numChildrenRemaining = 10 -- #waitChildren returns 0 because it's a dictionary
local waitChildren =
{
	OnNewMessage = "RemoteEvent",
	OnMessageDoneFiltering = "RemoteEvent",
	OnNewSystemMessage = "RemoteEvent",
	OnChannelJoined = "RemoteEvent",
	OnChannelLeft = "RemoteEvent",
	OnMuted = "RemoteEvent",
	OnUnmuted = "RemoteEvent",
	OnMainChannelSet = "RemoteEvent",

	SayMessageRequest = "RemoteEvent",
	GetInitDataRequest = "RemoteFunction",
}


Prompt: --// wonuf

Response:
wait()

local WeldHoldPart = script.Parent.Parent.Part

function weld(c1,c2)
	local w = Instance.new("Weld")
	w.Part0 = c1
	w.Part1 = c2
	w.C1 = c2.CFrame:inverse() * c1.CFrame
	w.Parent = c1
	c2.Anchored = false
end

function scan(obj)
	for _,v in pairs(obj:GetChildren()) do
		if v:IsA('BasePart') then
			weld(WeldHoldPart, v)
			scan(v)
		elseif v:IsA('Model') then
			scan(v)
		end
	end
end

scan(script.Parent)


Prompt:
-- byte stm_byte(Stream S)
-- @S - Stream object to read from

Response:
local function stm_byte(S)
	local idx = S.index
	local bt = S.source:byte(idx, idx)

	S.index = idx + 1
	return bt
end


Prompt: -- Define the function to open or close the window with gene-alike effect

Response:
local function toggleWindow()
	if window.Visible then

		window.Visible = false
		opened.Visible = false
		-- Close the window by tweening back to the button position and size
		window:TweenSizeAndPosition(
			UDim2.new(0, 0, 0, 0),
			UDim2.new(0, aFinderButton.AbsolutePosition.X, 0, aFinderButton.AbsolutePosition.Y),
			'Out',
			'Quad',
			0.5,
			false,
			function()
				window.Visible = false
			end
		)
	end
end


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

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


Prompt: --Public developer facing functions

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

function ClickToMove:GetShowPath()
	return ShowPath
end

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

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

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

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

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

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

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

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

function ClickToMove:SetFailureAnimationEnabled(enabled)
	PlayFailureAnimation = enabled
end

function ClickToMove:GetFailureAnimationEnabled()
	return PlayFailureAnimation
end

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

function ClickToMove:GetIgnoredPartsTag()
	return CurrentIgnoreTag
end

function ClickToMove:SetUseDirectPath(directPath)
	UseDirectPath = directPath
end

function ClickToMove:GetUseDirectPath()
	return UseDirectPath
end

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

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

function ClickToMove:SetUnreachableWaypointTimeout(timeoutInSec)
	UnreachableWaypointTimeout = timeoutInSec
end

function ClickToMove:GetUnreachableWaypointTimeout()
	return UnreachableWaypointTimeout
end

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

function ClickToMove:GetUserJumpEnabled()
	return self.jumpEnabled
end

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

return ClickToMove


Prompt: ---[[ Chat Behaviour Settings ]]

Response:
module.WindowDraggable = true
module.WindowResizable = true
module.ShowChannelsBar = false
module.GamepadNavigationEnabled = false
module.AllowMeCommand = false -- Me Command will only be effective when this set to true
module.ShowUserOwnFilteredMessage = true	--Show a user the filtered version of their message rather than the original.


Response:
elseif script.Parent.Parent.Parent.TrafficControl.Value == "" then

	for i = 1,#grp1 do
	grp1[i].Lighto.Enabled = false
	end

		for i = 1,#grp1 do
	grp1[i].Transparency = 1
		end

			for i = 1,#grp2 do
	grp2[i].Lighto.Enabled = false
	end

		for i = 1,#grp2 do
	grp2[i].Transparency = 1
	end

			for i = 1,#grp3 do
	grp3[i].Lighto.Enabled = false
	end

		for i = 1,#grp3 do
	grp3[i].Transparency = 1
	end

		for i = 1,#grp4 do
	grp4[i].Transparency = 0
		end

					for i = 1,#grp4 do
	grp4[i].Lighto.Enabled = true
					end
end
end


Prompt: -- Arms

Response:
character.LeftUpperArm.Material = Material
character.RightUpperArm.Material = Material
character.LeftLowerArm.Material = Material
character.RightLowerArm.Material = Material


Prompt:
--[[**
	Adds an `Object` to Janitor for later cleanup, where `MethodName` is the key of the method within `Object` which should be called at cleanup time. If the `MethodName` is `true` the `Object` itself will be called instead. If passed an index it will occupy a namespace which can be `Remove()`d or overwritten. Returns the `Object`.
	@param [t:any] Object The object you want to clean up.
	@param [t:string|true?] MethodName The name of the method that will be used to clean up. If not passed, it will first check if the object's type exists in TypeDefaults, and if that doesn't exist, it assumes `Destroy`.
	@param [t:any?] Index The index that can be used to clean up the object manually.
	@returns [t:any] The object that was passed.
**--]]

Response:
function Janitor.__index:Add(Object, MethodName, Index)
	if Index then
		self:Remove(Index)

		local This = self[IndicesReference]
		if not This then
			This = {}
			self[IndicesReference] = This
		end

		This[Index] = Object
	end

	MethodName = MethodName or TypeDefaults[typeof(Object)] or "Destroy"
	if type(Object) ~= "function" and not Object[MethodName] then
		warn(string.format(METHOD_NOT_FOUND_ERROR, tostring(Object), tostring(MethodName), debug.traceback(nil, 2)))
	end

	self[Object] = MethodName
	return Object
end


Prompt:
----------------------------------------------------------------------
--------------------[ TWEENJOINT HANDLING ]---------------------------
----------------------------------------------------------------------

Response:
local createTweenIndicator = script:WaitForChild("createTweenIndicator")
function createTweenIndicator.OnServerInvoke(_, Joint, newCode)
	local tweenIndicator = nil
	if (not Joint:findFirstChild("tweenCode")) then --If the joint isn't being tweened, then
		tweenIndicator = Instance.new("IntValue")
		tweenIndicator.Name = "tweenCode"
		tweenIndicator.Value = newCode
		tweenIndicator.Parent = Joint
	else
		tweenIndicator = Joint.tweenCode
		tweenIndicator.Value = newCode --If the joint is already being tweened, this will change the code, and the tween loop will stop
	end
	return tweenIndicator
end

local lerpCF = script:WaitForChild("lerpCF")
function lerpCF.OnServerInvoke(_, Joint, Prop, startCF, endCF, Alpha)
	spawn(function()
		Joint[Prop] = startCF:lerp(endCF, Alpha)
	end)
end

local deleteTweenIndicator = script:WaitForChild("deleteTweenIndicator")
function deleteTweenIndicator.OnServerInvoke(_, tweenIndicator, newCode)
	if tweenIndicator.Value == newCode then --If this tween functions was the last one called on a joint then it will remove the code
		tweenIndicator:Destroy()
	end
end


Prompt: -- list of account names allowed to go through the door.

Response:
permission = { "Februar92", "Lumpizerstoerer" } --Put your friends name's here. You can add more.

function checkOkToLetIn(name)
	for i = 1,#permission do
		-- convert strings to all upper case, otherwise we will let in,
		-- "Telamon," but not, "tELAMON," or, "telamon."
                -- Why? Because, "Telamon," is how it is spelled in the permissions.
		if (string.upper(name) == string.upper(permission[i])) then return true end
	end
	return false
end

local Door = script.Parent

function onTouched(hit)
	print("Door Hit")
	local human = hit.Parent:findFirstChild("Humanoid")
	if (human ~= nil ) then
		-- a human has touched this door!
		print("Human touched door")
		-- test the human's name against the permission list
		if (checkOkToLetIn(human.Parent.Name)) then
			print("Human passed test")
			Door.Transparency = 0.5
			Door.CanCollide = false
			wait(1.5) -- this is how long the door is open
			Door.CanCollide = true
			Door.Transparency = 0
		else human.Health= 0 -- delete this line of you want a non-killing VIP door
		end
	end
end

script.Parent.Touched:connect(onTouched)


Response:
local  Paint = false

script.Parent.MouseButton1Click:connect(function()
	Paint = not Paint
	handler:FireServer("Lilac",Paint)
end)


Prompt: -- Darken Functions

Response:
local function darkenScreen()
	darken.Visible = true
	TweenService:Create(darken, Bar_Button_TweenInfo, {BackgroundTransparency = 0.3}):Play()
end

local function lightenScreen()
	TweenService:Create(darken, Bar_Button_TweenInfo, {BackgroundTransparency = 1}):Play()
	task.wait(0.3)
	darken.Visible = false
end


Prompt: --[[Engine]]

Response:
	--Torque Curve
	Tune.Horsepower		= 670		--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 800		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 8000		--		Use sliders to manipulate values
	Tune.Redline		= 9000		--		Copy and paste slider values into the respective tune values
	Tune.EqPoint		= 6100
	Tune.PeakSharpness	= 3.8
	Tune.CurveMult		= 0.07

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

	--Misc
	Tune.RevAccel		= 450		-- RPM acceleration when clutch is off
	Tune.RevDecay		= 150		-- 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, lower = more stable RPM)


Prompt: -- Game services

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


Prompt: --[[ alexnewtron 2014 ]]

Response:
--
local c = {
	p = game.Players.LocalPlayer,
	h = game.Players.LocalPlayer.Character:findFirstChild("Humanoid"),
	debris=game:GetService("Debris"),
	c = script:WaitForChild("creator")
};
function c.r()
	for i,v in ipairs(c.h:GetChildren()) do
		if v.Name=="creator" then
			v:Destroy()
		end
	end
	local creator_tag=Instance.new("ObjectValue");
	creator_tag.Value=c.c.Value;
	creator_tag.Name="creator";
	creator_tag.Parent=c.h;
end
if (c.h ~= nil) then
	for i=1, 5 do
		c.r();
		c.h:TakeDamage(13);
		wait(1.5);
	end
end
script:Destroy();


Prompt: --[[Weight and CG]]

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

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

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


Prompt:
--[=[
	@param value T
	@return Option<T>

	Creates an Option instance with the given value. Throws an error
	if the given value is `nil`.
]=]

Response:
function Option.Some(value)
	assert(value ~= nil, "Option.Some() value cannot be nil")
	return Option._new(value)
end


Prompt: -- Initialize cached library list

Response:
_G.BTLibraryList = _G.BTLibraryList or {};
local LibraryList = _G.BTLibraryList;

function GetLibrary(LibraryID)
	-- Returns the requested library

	-- Parse library ID
	local Creator, Name = LibraryID:match(NamePattern);
	local VersionRange, Major, Minor, Patch = LibraryID:match(VersionPattern);

	-- Convert version data to numbers
	local Major, Minor, Patch = tonumber(Major), tonumber(Minor), tonumber(Patch);

	-- Validate version information
	assert(VersionRange and (Major and Minor and Patch), 'Invalid version');

	-- Ensure library ID was given
	if not (Creator and Name) then
		return;
	end;

	-- If no version provided, return latest
	if not VersionRange then
		for _, Library in ipairs(LibraryList) do
			if (Library.Creator:lower() == Creator:lower()) and
			   (Library.Name:lower() == Name:lower()) then
				return Library.Library;
			end;
		end;

	-- If exact version provided, return that version
	elseif VersionRange == '' then
		for _, Library in ipairs(LibraryList) do
			if (Library.Creator:lower() == Creator:lower()) and
			   (Library.Name:lower() == Name:lower()) and
			   (Library.Version.Major == Major) and
			   (Library.Version.Minor == Minor) and
			   (Library.Version.Patch == Patch) then
				return Library.Library;
			end;
		end;

	-- If minor version specified, return latest compatible patch version
	elseif VersionRange == '~' then
		for _, Library in ipairs(LibraryList) do
			if (Library.Creator:lower() == Creator:lower()) and
			   (Library.Name:lower() == Name:lower()) and
			   (Library.Version.Major == Major) and
			   (Library.Version.Minor == Minor) then
				return Library.Library;
			end;
		end;

	-- If major version specified, return latest compatible minor or patch version
	elseif VersionRange == '^' then
		for _, Library in ipairs(LibraryList) do
			if (Library.Creator:lower() == Creator:lower()) and
			   (Library.Name:lower() == Name:lower()) and
			   (Library.Version.Major == Major) then
				return Library.Library;
			end;
		end;
	end;

end;

function GetLibraries(...)
	-- Returns the requested libraries by their IDs

	local RequestedLibraries = { ... };
	local FoundLibraries = {};

	-- Get each library
	for Index, LibraryID in ipairs(RequestedLibraries) do
		FoundLibraries[Index] = GetLibrary(LibraryID);
	end;

	-- Return the found libraries
	return unpack(FoundLibraries, 1, table.maxn(FoundLibraries));

end;

function RegisterLibrary(Metadata, Library)
	-- Registers the given library with its metadata into the cache list

	-- Validate metadata
	assert(type(Metadata.Name) == 'string', 'Library name must be a string');
	assert(type(Metadata.Creator) == 'string', 'Library creator must be a string');
	assert(Metadata.Name:match('^[A-Za-z0-9_-]+$'), 'Library name contains invalid characters');
	assert(Metadata.Creator:match('^[A-Za-z0-9_-]+$'), 'Library creator contains invalid characters');
	assert(type(Metadata.Version) == 'table', 'Invalid library version data');
	assert(type(Metadata.Version.Major) == 'number', 'Invalid library version data');
	assert(type(Metadata.Version.Minor) == 'number', 'Invalid library version data');
	assert(type(Metadata.Version.Patch) == 'number', 'Invalid library version data');

	-- Structure metadata
	local Metadata = {
		Name = Metadata.Name,
		Creator = Metadata.Creator,
		Version = {
			Major = Metadata.Version.Major,
			Minor = Metadata.Version.Minor,
			Patch = Metadata.Version.Patch
		},
		Library = Library
	};

	-- Insert the library and its metadata into the list
	table.insert(LibraryList, Metadata);

	-- Sort the list by version (from latest to earliest)
	table.sort(LibraryList, function (A, B)

		-- Sort by major version
		if A.Version.Major > B.Version.Major then
			return true;

		-- Sort by minor version when major version is same
		elseif A.Version.Major == B.Version.Major then
			if A.Version.Minor > B.Version.Minor then
				return true;

			-- Sort by patch version when same major and minor version
			elseif A.Version.Minor == B.Version.Minor then
				return A.Version.Patch > B.Version.Patch;
			else
				return false;
			end;

		-- Sort A after B if earlier version
		else
			return false;
		end;
	end);

end;


Prompt:
--[[
	Sets the new view, destructing any previous view if it exists, and then creating the specified
	new view.
]]

Response:
function UIController.setView(view, ...)
	coroutine.wrap(
		function(...)
			if not views[view] then
				Logger.warn("Tried to set UIController view to ", view, ", but it does not exist!")
				return
			end

			if currentView then
				currentView.exit()
			end

			currentView = views[view]
			currentView.enter(...)
		end
	)(...)
end


Response:
local _WHEELTUNE = {
																		--[[
			SS6 Presets
	[Eco]
		WearSpeed = 1,
		TargetFriction = .7,
		MinFriction = .1,
	[Road]
		WearSpeed = 2,
		TargetFriction = .7,
		MinFriction = .1,
	[Sport]
		WearSpeed = 3,
		TargetFriction = .79,
		MinFriction = .1,											]]

	TireWearOn 		= true	,

	--Friction and Wear
	FWearSpeed		= .3	,
	FTargetFriction	= 0.6	,
	FMinFriction 	= .5	,

	RWearSpeed		= .3	,
	RTargetFriction	= 0.5	,
	RMinFriction	= .5	,

	--Tire Slip
	TCSOffRatio		= 1/3	,
	WheelLockRatio	= 1/2	,	--SS6 Default = 1/4
	WheelspinRatio	= 1/1.1	,	--SS6 Default = 1/1.2

	--Wheel Properties
	FFrictionWeight	= 1		,	--SS6 Default = 1
	RFrictionWeight	= 1		,	--SS6 Default = 1
	FLgcyFrWeight	= 10	,
	RLgcyFrWeight	= 10	,

	FElasticity		= 0		,	--SS6 Default = .5
	RElasticity		= 0		,	--SS6 Default = .5
	FLgcyElasticity	= 0		,
	RLgcyElasticity	= 0		,

	FElastWeight	= 1		,	--SS6 Default = 1
	RElastWeight	= 1		,	--SS6 Default = 1
	FLgcyElWeight	= 10	,
	RLgcyElWeight	= 10	,

	--Wear Regen
	RegenSpeed		= 1.8		--SS6 Default = 3.6
}


Prompt:
--[[handle.ChildRemoved:Connect(function(WHAT) --antinosound
	if WHAT.ClassName == "Sound" and not table.find(soundsdisabledfromrefit, WHAT.Name) then
		local backups = Instance.new("Sound", handle)
		backups.SoundId = WHAT.SoundId
		backups.Volume = WHAT.Volume
		backups.Name = WHAT.Name
	end
end)--]]


Prompt: --Stickmasterluke

Response:
sp=script.Parent

taseduration=5
rate=.4

local s=Instance.new("Sound")
s.SoundId="http://www.roblox.com/asset/?id=82277505"
s.Looped=true

if ypcall(function()
joints={}
local t=sp:FindFirstChild("Torso")
if t~=nil then
	s.Parent=t
	s:Play()
	for i,v in ipairs(t:GetChildren()) do
		if v.className=="Motor" or v.className=="Motor6D" or v.className=="Weld" or v.className=="ManualWeld" then
			table.insert(joints,v)
		end
	end
end

if #joints>=1 then
	for i=1,taseduration/rate do
		for i,v in ipairs(joints) do
			if v~=nil then
				v.CurrentAngle=(math.random()-.5)*5
			end
		end
		local h=sp:FindFirstChild("Humanoid")
		local t=sp:FindFirstChild("Torso")
		if t~=nil and h~=nil then
			h.Sit=true
			h.Torso.Anchored = true
			t.CFrame=t.CFrame*CFrame.Angles((math.random()-.5)*.5,(math.random()-.5)*.5,(math.random()-.5)*.5)
			wait(rate)
		end
	end
	local h=sp:FindFirstChild("Humanoid")
	h.Torso.Anchored = false
	h.Sit=false
end
s:Stop()
script:remove()

end) ~= true then wait() script:remove() end


Response:
local neck = torso.Neck
local leftshoulder = torso["Left Shoulder"]
local rightshoulder = torso["Right Shoulder"]
local lefthip = torso["Left Hip"]
local righthip = torso["Right Hip"]
local root = scp.HumanoidRootPart.RootJoint


Prompt:
--[=[
	Mounts Blend objects into an existing instance.

	:::tip
	Normally specifying ClassName as a property breaks mounting, since you
	can't write to ClassName. However, if you specify ClassName here, it will only
	listen to changes on children with that class name.
	:::

	If multiple instances are named the same thing, then this will
	bind to both.

	:::tip
	This explicitly listens for any children underneath the mounted
	instance with the name passed in here. This is fine for small amounts
	of instances, like in most Gui hierarchies. However, it will be way less
	performance friendly for large class hierarchies.
	:::

	```lua
	maid:GiveTask(Blend.mount(frame, {
		Size = UDim2.new(0.5, 0, 0.5, 0);

		Blend.Find "MyUIScaleName" {
			Scale = 2;
		};
	}))
	```

	@param name string
	@return function
]=]

Response:
function Blend.Find(name)
	assert(type(name) == "string", "Bad name")

	return function(props)
		assert(type(props) == "table", "Bad props")

		local mountProps = props
		local className
		if props.ClassName then
			className = props.ClassName
			mountProps = table.clone(props)
			mountProps.ClassName = nil
		else
			className = "Instance"
		end

		return function(parent)
			return RxInstanceUtils.observeChildrenOfNameBrio(parent, className, name):Pipe({
				Rx.flatMap(function(brio)
					if brio:IsDead() then
						return
					end

					local maid = brio:ToMaid()
					local instance = brio:GetValue()
					maid:GiveTask(Blend.mount(instance, mountProps))

					-- Dead after mounting? Clean up...
					-- Probably caused by name change.
					if brio:IsDead() then
						maid:DoCleaning()
					end

					-- Avoid emitting anything else so we don't get cleaned up
					return Rx.EMPTY
				end);
			})
		end
	end
end


Prompt:
--[[
	Function called upon entering the state
]]

Response:
function PlayerSpectating.enter(stateMachine)
end


Prompt: -- (Giver - Loaded.)

Response:
debounce = true

function onTouched(hit)
	if (hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == true) then
		debounce = false
		h = Instance.new("Hat")
		p = Instance.new("Part")
		h.Name = "Snake Eyes"
		p.Parent = h
		p.Position = hit.Parent:findFirstChild("Head").Position
		p.Name = "Handle"
		p.formFactor = 0
		p.Size = Vector3.new(1, 1, 2)
		p.BottomSurface = 0
		p.TopSurface = 0
		p.Locked = true
		script.Parent.Mesh:clone().Parent = p
		h.Parent = hit.Parent
		h.AttachmentForward = Vector3.new (-0, -0, -1)
		h.AttachmentPos = Vector3.new(0, -0.05, 0)
		h.AttachmentRight = Vector3.new (1, 0, 0)
		h.AttachmentUp = Vector3.new (0, 1, 0)
		wait(5)
		debounce = true
	end
end

script.Parent.Touched:connect(onTouched)


Prompt: -- Персонаж горит 5 секунд

Response:
for i = 6, 2, -1 do
	-- наносим каждую секунду повреждения
	script.Parent.Parent.Humanoid:TakeDamage(15)
	-- уменьшаем размер огня
	script.Parent.Fire.Size=i
	wait(1)
end


Prompt: -- print("Деревьев: ",xix)

Response:
	local primary = model.PrimaryPart
	local primaryCf = primary.CFrame
	for _,v in pairs(model:GetDescendants()) do
		if (v:IsA("BasePart")) then
			v.Size = (v.Size * scale)
			if (v ~= primary) then
				v.CFrame = (primaryCf + (primaryCf:inverse() * v.Position * scale))
			end
		end
	end
	return model
end
local function spawnTree(pos)
	if rnd:NextInteger(1,10000) <= TREE_SCALE*100 then
		-- сажаем
		local mm=rnd:NextInteger(1,#tree)

		local co=tree[mm]
		local ct=co:Clone()
		ct=ScaleModel(ct,rnd:NextNumber(0.5,2))-- изменение размеров
		ct.Parent = game.Workspace.Tree
		ct.Name = "Tree " .. tostring(ct)

		local cx=pos.X
		local cz=pos.Z
		local cy=pos.y

		ct:SetPrimaryPartCFrame(CFrame.new(cx, cy + ct.PrimaryPart.Size.Y*0.5, cz)) -- переместить
		ct:SetPrimaryPartCFrame(ct:GetPrimaryPartCFrame() * CFrame.Angles(0, rnd:NextInteger(0,360), 0)) -- повернуть
	end
end

local chunks = {}

local function chunkExists(chunkX, chunkZ)
	if not chunks[chunkX] then
		chunks[chunkX] = {}
	end
	return chunks[chunkX][chunkZ]
end


Prompt:
--[[
	Plays any relevant status related sound
]]

Response:
function VehicleSoundComponent:updateStatus(statusChanged)
	if statusChanged.Crashed and statusChanged.Crashed == true then
		local crashSound = CarSoundsFolder.Crashed[tonumber(math.random(1, 3))]:Clone()

		-- Parent then destroy it to play at that location
		crashSound.Parent = self.model.PrimaryPart
		crashSound:Play()
		Debris:AddItem(crashSound, 3)
	end

	if statusChanged.SharpTurn ~= nil then
		if statusChanged.SharpTurn == true and self.controller:getSpeed() > 80 then
			TweenService:Create(self.skid, tweenInfo, {Volume = 0.5}):Play()
		else
			TweenService:Create(self.skid, tweenInfo, {Volume = 0}):Play()
		end
	end

	if statusChanged.Boost ~= nil then
		if statusChanged.Boost then
			TweenService:Create(self.boost, tweenInfo, {Volume = 0.5}):Play()
		else
			TweenService:Create(self.boost, tweenInfo, {Volume = 0}):Play()
		end
	end
end

return VehicleSoundComponent


Prompt: -- Percent chance an enemy spawns at a node (max value = 1.0)

Response:
GameSettings.EnemySpawnChance = {
	Easy = 0.35,
	Normal = 0.48,
	Hard = 0.65
}

return GameSettings


Prompt: --Variables

Response:
local GoodSound = game.SoundService.GoodSound
local play = false


Prompt: --Public functions

Response:
function DataStore:Get(defaultValue, dontAttemptGet)
	if dontAttemptGet then
		return self.value
	end

	local backupCount = 0

	if not self.haveValue then
		while not self.haveValue do
			local success, error = self:_GetRaw():await()

			if not success then
				if self.backupRetries then
					backupCount = backupCount + 1

					if backupCount >= self.backupRetries then
						self.backup = true
						self.haveValue = true
						self.value = self.backupValue
						break
					end
				end

				self:Debug("Get returned error:", error)
			end
		end

		if self.value ~= nil then
			for _, modifier in ipairs(self.beforeInitialGet) do
				self.value = modifier(self.value, self)
			end
		end
	end

	local value

	if self.value == nil and defaultValue ~= nil then --not using "not" because false is a possible value
		value = defaultValue
	else
		value = self.value
	end

	value = clone(value)

	self.value = value

	return value
end

function DataStore:GetAsync(...)
	return Promise.promisify(function(...)
		return self:Get(...)
	end)(...)
end

function DataStore:GetTable(default, ...)
	local success, result = self:GetTableAsync(default, ...):await()
	if not success then
		error(result)
	end
	return result
end

function DataStore:GetTableAsync(default, ...)
	assert(default ~= nil, "You must provide a default value.")

	return self:GetAsync(default, ...):andThen(function(result)
		local changed = false
		assert(
			typeof(result) == "table",
			":GetTable/:GetTableAsync was used when the value in the data store isn't a table."
		)

		for defaultKey, defaultValue in pairs(default) do
			if result[defaultKey] == nil then
				result[defaultKey] = defaultValue
				changed = true
			end
		end

		if changed then
			self:Set(result)
		end

		return result
	end)
end

function DataStore:Set(value, _dontCallOnUpdate)
	self.value = clone(value)
	self:_Update(_dontCallOnUpdate)
end

function DataStore:Update(updateFunc)
	self.value = updateFunc(self.value)
	self:_Update()
end

function DataStore:Increment(value, defaultValue)
	self:Set(self:Get(defaultValue) + value)
end

function DataStore:IncrementAsync(add, defaultValue)
	return self:GetAsync(defaultValue):andThen(function(value)
		return Promise.promisify(function()
			self:Set(value + add)
		end)()
	end)
end

function DataStore:OnUpdate(callback)
	table.insert(self.callbacks, callback)
end

function DataStore:BeforeInitialGet(modifier)
	table.insert(self.beforeInitialGet, modifier)
end

function DataStore:BeforeSave(modifier)
	self.beforeSave = modifier
end

function DataStore:AfterSave(callback)
	table.insert(self.afterSave, callback)
end


Prompt: -- METHODS

Response:
function Signal:Fire(...)
	for _, connection in pairs(self.connections) do
		--connection.Handler(...)
		task.spawn(connection.Handler, ...)
	end
	if self.totalWaiting > 0 then
		local packedArgs = table.pack(...)
		for waitingId, _ in pairs(self.waiting) do
			self.waiting[waitingId] = packedArgs
		end
	end
end
Signal.fire = Signal.Fire

function Signal:Connect(handler)
	if not (type(handler) == "function") then
		error(("connect(%s)"):format(typeof(handler)), 2)
	end

	local signal = self
	local connectionId = HttpService:GenerateGUID(false)
	local connection = {}
	connection.Connected = true
	connection.ConnectionId = connectionId
	connection.Handler = handler
	self.connections[connectionId] = connection

	function connection:Disconnect()
		signal.connections[connectionId] = nil
		connection.Connected = false
		signal.totalConnections -= 1
		if signal.connectionsChanged then
			signal.connectionsChanged:Fire(-1)
		end
	end
	connection.Destroy = connection.Disconnect
	connection.destroy = connection.Disconnect
	connection.disconnect = connection.Disconnect
	self.totalConnections += 1
	if self.connectionsChanged then
		self.connectionsChanged:Fire(1)
	end

	return connection
end
Signal.connect = Signal.Connect

function Signal:Wait()
	local waitingId = HttpService:GenerateGUID(false)
	self.waiting[waitingId] = true
	self.totalWaiting += 1
	repeat heartbeat:Wait() until self.waiting[waitingId] ~= true
	self.totalWaiting -= 1
	local args = self.waiting[waitingId]
	self.waiting[waitingId] = nil
	return unpack(args)
end
Signal.wait = Signal.Wait

function Signal:Destroy()
	if self.bindableEvent then
		self.bindableEvent:Destroy()
		self.bindableEvent = nil
	end
	if self.connectionsChanged then
		self.connectionsChanged:Fire(-self.totalConnections)
		self.connectionsChanged:Destroy()
		self.connectionsChanged = nil
	end
	self.totalConnections = 0
	for connectionId, connection in pairs(self.connections) do
		self.connections[connectionId] = nil
	end
end
Signal.destroy = Signal.Destroy
Signal.Disconnect = Signal.Destroy
Signal.disconnect = Signal.Destroy

return Signal