Pinkstack/roblox-luau-corpus-text huggingface dataset:
-- given an Instance and a property-value table subset, returns
-- an InstanceSubset object representing the subset of Instance with values in the subset table
-- and a InstanceSubset object representing the subset table


local function getInstanceSubset(instance: any, subset: any, seenReferences): any
	seenReferences = seenReferences or {}

	local trimmed: any = {}
	seenReferences[instance] = trimmed

	-- return non-table primitives
	if equals(instance, subset) then
		return subset, subset
	elseif typeof(subset) ~= "table" or isAsymmetric(subset) then
		return instance, subset
	end

	-- collect non-table primitive values
	local newSubset = {}
	for k, v in pairs(subset) do
		if typeof(v) ~= "table" then
			newSubset[k] = v
		end
	end

	local propsAndChildren = getRobloxProperties(instance.ClassName)
	for _, v in ipairs(instance:getChildren()) do
		table.insert(propsAndChildren, v.Name)
	end

	for i, prop in
		ipairs(Array.filter(propsAndChildren, function(prop)
			return hasPropertyInObject(subset, prop)
		end))
	do
		if seenReferences[instance[prop]] ~= nil then
			error("Circular reference passed into .toMatchInstance(subset)")
		else
			local nestedSubset
			trimmed[prop], nestedSubset = getInstanceSubset(instance[prop], subset[prop], seenReferences)
			newSubset[prop] = nestedSubset
		end
	end

	-- serialize with a different ClassName if the subset has ClassName defined,
	-- otherwise treat it as the same class as the original Instance
	local subsetClassName = instance.ClassName
	if typeof(subset) == "table" and rawget(subset, "ClassName") then
		subsetClassName = rawget(subset, "ClassName")
	end

	return InstanceSubset.new(instance.ClassName, trimmed), InstanceSubset.new(subsetClassName, newSubset)
end

return {
	getRobloxProperties = getRobloxProperties,
	instanceSubsetEquality = instanceSubsetEquality,
	InstanceSubset = InstanceSubset,
	getInstanceSubset = getInstanceSubset,
}
--[[Drivetrain]]

	
Tune.Config			= "RWD"		--"FWD" , "RWD" , "AWD"
	
	--Differential Settings	
	Tune.FDiffSlipThres	= 50		-- 1 - 100%				(Max threshold of applying full lock determined by deviation from avg speed)
	Tune.FDiffLockThres	= 50		-- 0 - 100%				(0 - Bias toward slower wheel, 100 - Bias toward faster wheel)
	Tune.RDiffSlipThres	= 50		-- 1 - 100%
	Tune.RDiffLockThres	= 50		-- 0 - 100%
	Tune.CDiffSlipThres	= 50		-- 1 - 100%				[AWD Only]
	Tune.CDiffLockThres	= 50		-- 0 - 100%				[AWD Only]
	
	--Traction Control Settings
	Tune.TCSEnabled		= true		-- Implements TCS
	Tune.TCSThreshold	= 10		-- Slip speed allowed before TCS starts working (in SPS)
	Tune.TCSGradient	= 20		-- Slip speed gradient between 0 to max reduction (in SPS)
	Tune.TCSLimit		= 10		-- Minimum amount of torque at max reduction (in percent)
--------------------------------------------------------------------------



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		= .8	,
	FTargetFriction	= 1.02	,
	FMinFriction 	= .1	,
	
	RWearSpeed		= .8	,
	RTargetFriction	= 1.2	,
	RMinFriction	= .1	,
	
	--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		= .5		,	--SS6 Default = .5
	RElasticity		= .5		,	--SS6 Default = .5
	FLgcyElasticity	= 0		,
	RLgcyElasticity	= 0		,
	
	FElastWeight	= 1		,	--SS6 Default = 1
	RElastWeight	= 1		,	--SS6 Default = 1
	FLgcyElWeight	= 10	,
	RLgcyElWeight	= 10	,
	
	--Wear Regen
	RegenSpeed		= 3.6		--SS6 Default = 3.6
}
--[[ By: Brutez, 2/28/2015, 1:34 AM, (UTC-08:00) Pacific Time (US & Canada) ]]

--
local PlayerSpawning=false; --[[ Change this to true if you want the NPC to spawn like a player, and change this to false if you want the NPC to spawn at it's current position. ]]--
local AdvancedRespawnScript=script;
repeat Wait(0)until script and script.Parent and script.Parent:IsA("Model");
local AlfredDrevis=AdvancedRespawnScript.Parent;
if AdvancedRespawnScript and AlfredDrevis and AlfredDrevis:FindFirstChild("Thumbnail")then
AlfredDrevis:FindFirstChild("Thumbnail"):Destroy();
end;
local GameDerbis=Game:GetService("Debris");
local AlfredDrevisHumanoid;
for _,Child in pairs(AlfredDrevis:GetChildren())do
if Child and Child:IsA("Humanoid")and Child.Health~=0 then
AlfredDrevisHumanoid=Child;
end;
end;
local Respawndant=AlfredDrevis:Clone();
if PlayerSpawning then --[[ LOOK AT LINE: 2. ]]--
Spawn(function()
if AlfredDrevis and AlfredDrevisHumanoid and AlfredDrevisHumanoid:FindFirstChild("Status")and not AlfredDrevisHumanoid:FindFirstChild("Status"):FindFirstChild("AvalibleSpawns")then
SpawnModel=Instance.new("Model");
SpawnModel.Parent=AlfredDrevisHumanoid.Status;
SpawnModel.Name="AvalibleSpawns";
else
SpawnModel=AlfredDrevisHumanoid:FindFirstChild("Status"):FindFirstChild("AvalibleSpawns");
end;
function FindSpawn(SearchValue)
local PartsArchivable=SearchValue:GetChildren();
for AreaSearch=1,#PartsArchivable do
if PartsArchivable[AreaSearch]:IsA("SpawnLocation")then
local PositionValue=Instance.new("Vector3Value",SpawnModel);
PositionValue.Value=PartsArchivable[AreaSearch].Position;
PositionValue.Name=PartsArchivable[AreaSearch].Duration;
end;
FindSpawn(PartsArchivable[AreaSearch]);
end;
end;
FindSpawn(Game:GetService("Workspace"));
local SpawnChilden=SpawnModel:GetChildren();
if#SpawnChilden>0 then
local SpawnItself=SpawnChilden[math.random(1,#SpawnChilden)];
local RespawningForceField=Instance.new("ForceField");
RespawningForceField.Parent=AlfredDrevis;
RespawningForceField.Name="SpawnForceField";
GameDerbis:AddItem(RespawningForceField,SpawnItself.Name);
AlfredDrevis:MoveTo(SpawnItself.Value+Vector3.new(0,3.5,0));
else
if AlfredDrevis:FindFirstChild("SpawnForceField")then
AlfredDrevis:FindFirstChild("SpawnForceField"):Destroy();
end;
AlfredDrevis:MoveTo(Vector3.new(0,115,0));
end;
end);
end;
function Respawn()
Wait(5);
Respawndant.Parent=AlfredDrevis.Parent;
Respawndant:makeJoints();
Respawndant:FindFirstChild("Head"):MakeJoints();
Respawndant:FindFirstChild("Torso"):MakeJoints();
AlfredDrevis:remove();
end;
if AdvancedRespawnScript and AlfredDrevis and AlfredDrevisHumanoid then
AlfredDrevisHumanoid.Died:connect(Respawn);
end;
--[[
	Connect to the datastore, set up connections and create resources used by
	the server

	Parameters:
	configValues: A table containing configuration values
]]


local function setup(configValues)
	local tokenDataStore = DataStoreService:GetDataStore(configValues.datastoreName)
	local tokenManager = TokenManager.new(tokenDataStore)
	local tokens = CollectionService:GetTagged(configValues.tokenTag)

	tokenManager:setTokens(tokens)

	disconnectOldConnections()

	connections[1] = CollectionService
		:GetInstanceAddedSignal(configValues.tokenTag)
		:Connect(onTokenAdded(remoteEvents, tokenManager))
	connections[2] = CollectionService
		:GetInstanceRemovedSignal(configValues.tokenTag)
		:Connect(onTokenRemoved(remoteEvents, tokenManager))
	connections[3] = Players.PlayerAdded:Connect(onPlayerAdded(remoteEvents, tokenDataStore, tokenManager))
	connections[4] = Players.PlayerRemoving:Connect(onPlayerRemoved(tokenDataStore, tokenManager))
	connections[5] = events.disable.Event:Connect(onHuntDisabled(tokenManager))
	connections[6] = events.enable.Event:Connect(onHuntEnabled(tokenManager))
end

config.changed:Connect(setup)

setup(config.getValues())
-- initialization/finalization stuff



function makeGyro(humanoid)
	Gyro = Instance.new("BodyGyro")
	Gyro.Name = "SkateboardGyro"
	Gyro.maxTorque = Vector3.new(0,0,0) -- start off
	Gyro.P = 65
	Gyro.D = 65
	Gyro.Parent = humanoid.Parent.Torso
end

function onButtonChanged(button)
	if button == Enum.Button.Dismount then
		Board.ControllingHumanoid.Jump = Controller:getButton(Enum.Button.Dismount)
	end
	if button == Enum.Button.Jump then
		if Controller:getButton(Enum.Button.Jump) and jumpok then
			jumpok = false
			KickAnim:Stop()
			LeftAnim:Stop(.5)

			RightAnim:Stop(.5)
			OllieAnim:Play(0,1,4)
			Board.StickyWheels = false
			Board:ApplySpecificImpulse(Vector3.new(0,50,0))
			OllieHack.force = Vector3.new(0,1400,0)
			didAction("jump")
			delay(.1, function() if (OllieHack ~= nil) then OllieHack.force = Vector3.new(0,0,0) end end)
		else
			Board.StickyWheels = true
		end
	end
end

function onEquip(humanoid, controller)
	print("Board equipped")
	print(controller)
	if not Controller then -- debounce
		Controller = controller
		
		makeGyro(humanoid)
		controller.AxisChanged:connect(onAxisChanged)
		Board.MoveStateChanged:connect(onMoveStateChanged)
		CoastingAnim = humanoid:loadAnimation(Board.coastingpose)	
		LeftAnim = humanoid:loadAnimation(Board.leftturn)
		RightAnim = humanoid:loadAnimation(Board.rightturn)
		OllieAnim = humanoid:loadAnimation(Board.ollie)
		--OllieAnim:AdjustSpeed(2)
		KickAnim = humanoid:loadAnimation(Board.boardkick)
		CoastingAnim:Play()

		Controller:bindButton(Enum.Button.Jump, "Ollie")
		Controller:bindButton(Enum.Button.Dismount, "Dismount")
		Controller.ButtonChanged:connect(onButtonChanged)
	end
end

function onUnequip(board)
	print("Board unequipped")
	Controller = nil
	Gyro.Parent = nil
	Gyro= nil
	CoastingAnim:Stop()
	KickAnim:Stop()
	CoastingAnim = nil
	KickAnim = nil
	LeftAnim:Stop()
	LeftAnim = nil
	RightAnim:Stop()
	RightAnim = nil
	OllieAnim:Stop()
	OllieAnim = nil

	if (OllieThrust ~= nil) then
		OllieThrust:Remove()
		OllieThrust = nil
	end

	Board.CruiseLoop:Stop()
end
-- functions



function stopAllAnimations()
	local oldAnim = currentAnim

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

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

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

	-- clean up walk if there is one
	doForAllRunTracks(function(trackRec, name)
		if trackRec.handler ~= nil then
			trackRec.handler:disconnect()
		end					
	end)

	doForAllRunTracks(function(trackRec, name)
		if (trackRec.track ~= nil) then
			trackRec.track:Stop()
			trackRec.track:Destroy()
			trackRec.track = nil
		end		
	end)
	
	return oldAnim
end

function getHeightScale()
	if Humanoid then
		if not Humanoid.AutomaticScalingEnabled then
			return 1
		end
		
		local scale = Humanoid.HipHeight / HumanoidHipHeight
		if userAnimationSpeedDampening then
			if AnimationSpeedDampeningObject == nil then
				AnimationSpeedDampeningObject = script:FindFirstChild("ScaleDampeningPercent")
			end
			if AnimationSpeedDampeningObject ~= nil then
				scale = 1 + (Humanoid.HipHeight - HumanoidHipHeight) * AnimationSpeedDampeningObject.Value / HumanoidHipHeight
			end
		end
		return scale
	end	
	return 1
end
-- http://qaru.site/questions/11544765/roblox-rotating-a-model



local par=original.Parent -- сохраняем привязку 
original.Parent=game.ReplicatedStorage -- прячем оригинал
wait(3)

local dist = 45 -- растояние от центра
local angle = 30 -- угол разброса (чтобы 360 нацело делилось!!!)
--[ Functions ]--


function CreateWeld(Part, CF)
	local w = Instance.new("Weld")
	w.Name = "LegWeld"
	w.Parent = Torso
	w.Part0 = Torso
	w.Part1 = Part
	w.C1 = CF
end

function StandUp()
	-- Right Leg
	RH.Part1 = RL

	-- Left Leg
	LH.Part1 = LL

	-- Delete Welds
	for i, s in pairs(Torso:GetChildren()) do
		if (s.Name == "LegWeld") and (s.ClassName == "Weld") then
			s:Destroy()
		end
	end

	-- Raise Character
	RJ.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
	RJ.C1 = CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
end
-- (Hat Giver Script - Loaded.)



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 = "BlueWinterCap"
		p.Parent = h
		p.Position = hit.Parent:findFirstChild("Head").Position
		p.Name = "Handle" 
		p.formFactor = 0
		p.Size = Vector3.new(0,-0.25,0) 
		p.BottomSurface = 0 
		p.TopSurface = 0 
		p.Locked = true 
		script.Parent.Mesh:clone().Parent = p
		h.Parent = hit.Parent
		h.AttachmentPos = Vector3.new(0, 0.4, -0.1)
		h.AttachmentRight = Vector3.new(1, 0, 0)
		h.AttachmentUp = Vector3.new(0, 0.995, -0.0995)
		h.AttachmentForward = Vector3.new(-0, -0.0995, -0.995)
		wait(5)
		debounce = true
	end
end

script.Parent.Touched:connect(onTouched)
--[[



]]



local ReplicatedStorage = game:GetService("ReplicatedStorage")

local AvatarEditor = ReplicatedStorage.AvatarEditor
local Spring = require(AvatarEditor.Shared.Util.Spring)
local Maid = require(AvatarEditor.Shared.Util.Maid)
local Settings = require(AvatarEditor.Shared.Settings)
local Theme = require(AvatarEditor.Client.Theme)

local Class = {}
Class.__index = Class


function Class.new(guiButton, callback)
	local self = setmetatable({}, Class)
	
	self.Button = guiButton
	
	self.ColorSpring = Spring.new(0)
	self.ColorSpring.Damper = 1
	self.ColorSpring.Speed = 20
	
	self.Maid = Maid.new()
	
	self.Maid:GiveTask(guiButton.InputBegan:Connect(function(inputObject)
		if not Settings.HOVER_INPUTS[inputObject.UserInputType] then
			return
		end
		guiButton.MaxVisibleGraphemes = -1
		guiButton.Icon.Visible = false
	end))
	
	self.Maid:GiveTask(guiButton.InputEnded:Connect(function(inputObject)
		if not Settings.HOVER_INPUTS[inputObject.UserInputType] then
			return
		end
		guiButton.MaxVisibleGraphemes = 0
		guiButton.Icon.Visible = true
	end))
	
	self.Maid:GiveTask(guiButton.Activated:Connect(callback))
	
	return self
end


function Class:OnRenderStep(delta)
	local colorSpring = self.ColorSpring
	local button = self.Button
	
	colorSpring:TimeSkip(delta)
	
	local pos = colorSpring.Position
	local color = Theme:GetColor("Deselected"):lerp(Theme:GetColor("Selected"), pos)
	button.Icon.ImageColor3 = color
	button.TextColor3 = color
end


function Class:Destroy()
	self.Maid:DoCleaning()
	self.Maid = nil
	
	self.Button = nil
	self.ColorSpring = nil
	
	setmetatable(self, nil)
end


return Class
--Scripted by DermonDarble



local car = script.Parent
local stats = car.Configurations
local Raycast = require(script.RaycastModule)

local mass = 0

for i, v in pairs(car:GetChildren()) do
	if v:IsA("BasePart") then
		mass = mass + (v:GetMass() * 196.2)
	end
end

local bodyPosition = Instance.new("BodyPosition", car.Chassis)
bodyPosition.MaxForce = Vector3.new()
local bodyGyro = Instance.new("BodyGyro", car.Chassis)
bodyGyro.MaxTorque = Vector3.new()

local function UpdateThruster(thruster)
	-- Raycasting
	local hit, position = Raycast.new(thruster.Position, thruster.CFrame:vectorToWorldSpace(Vector3.new(0, -1, 0)) * stats.Height.Value) --game.Workspace:FindPartOnRay(ray, car)
	local thrusterHeight = (position - thruster.Position).magnitude

	-- Wheel
	local wheelWeld = thruster:FindFirstChild("WheelWeld")
	wheelWeld.C0 = CFrame.new(0, -math.min(thrusterHeight, stats.Height.Value * 0.8) + (wheelWeld.Part1.Size.Y / 2), 0)
	-- Wheel turning
	local offset = car.Chassis.CFrame:inverse() * thruster.CFrame
	local speed = car.Chassis.CFrame:vectorToObjectSpace(car.Chassis.Velocity)
	if offset.Z < 0 then
		local direction = 1
		if speed.Z > 0 then
			direction = -1
		end
		wheelWeld.C0 = wheelWeld.C0 * CFrame.Angles(0, (car.Chassis.RotVelocity.Y / 2) * direction, 0)
	end

	-- Particles
	if hit and thruster.Velocity.magnitude >= 5 then
		wheelWeld.Part1.ParticleEmitter.Enabled = true
	else
		wheelWeld.Part1.ParticleEmitter.Enabled = false
	end
end

car.DriveSeat.Changed:connect(function(property)
	if property == "Occupant" then
		if car.DriveSeat.Occupant then
			local player = game.Players:GetPlayerFromCharacter(car.DriveSeat.Occupant.Parent)
			if player then
				car.DriveSeat:SetNetworkOwner(player)
				local localCarScript = script.LocalCarScript:Clone()
				localCarScript.Parent = player.PlayerGui
				localCarScript.Car.Value = car
				localCarScript.Disabled = false
			end
		end
	end
end)

spawn(function()
	while true do
		game:GetService("RunService").Stepped:wait()
		for i, part in pairs(car:GetChildren()) do
			if part.Name == "Thruster" then
				UpdateThruster(part)
			end
		end
		if car.DriveSeat.Occupant then
			bodyPosition.MaxForce = Vector3.new()
			bodyGyro.MaxTorque = Vector3.new()
		else
			local hit, position, normal = Raycast.new(car.Chassis.Position, car.Chassis.CFrame:vectorToWorldSpace(Vector3.new(0, -1, 0)) * stats.Height.Value)
			if hit and hit.CanCollide then
				bodyPosition.MaxForce = Vector3.new(mass / 5, math.huge, mass / 5)
				bodyPosition.Position = (CFrame.new(position, position + normal) * CFrame.new(0, 0, -stats.Height.Value + 0.5)).p
				bodyGyro.MaxTorque = Vector3.new(math.huge, 0, math.huge)
				bodyGyro.CFrame = CFrame.new(position, position + normal) * CFrame.Angles(-math.pi/2, 0, 0)
			else
				bodyPosition.MaxForce = Vector3.new()
				bodyGyro.MaxTorque = Vector3.new()
			end
		end
	end
end)
----------------------------------------------------------------------------------------------------
-----------------=[ RECOIL & PRECISAO ]=------------------------------------------------------------
----------------------------------------------------------------------------------------------------


	,VRecoil = {14,18}				--- Vertical Recoil
	,HRecoil = {9,12}				--- Horizontal Recoil
	,AimRecover = .65				---- Between 0 & 1
	
	,RecoilPunch = .15
	,VPunchBase = 2.55				--- Vertical Punch
	,HPunchBase = 1.6				--- Horizontal Punch
	,DPunchBase = 1 				--- Tilt Punch | useless
	
	,AimRecoilReduction = 5 		--- Recoil Reduction Factor While Aiming (Do not set to 0)
	,PunchRecover = 0.2
	,MinRecoilPower = .5
	,MaxRecoilPower = 3
	,RecoilPowerStepAmount = .25
	
	,MinSpread = 0.95				--- Min bullet spread value | Studs
	,MaxSpread = 47					--- Max bullet spread value | Studs
	,AimInaccuracyStepAmount = .75
	,WalkMultiplier = 0				--- Bullet spread based on player speed

	,SwayBase = 0.05				--- Weapon Base Sway | Studs
	,MaxSway =	1.5					--- Max sway value based on player stamina | Studs
-- Create component


local LoadingSpinner = Roact.PureComponent:extend 'LoadingSpinner'

function LoadingSpinner:init()
    self.instance = Roact.createRef()
end

function LoadingSpinner:didMount()
    coroutine.wrap(function ()
        self.Running = true
        while self.Running and self.instance.current do
            local Spinner = self.instance.current
            Spinner.Rotation = (Spinner.Rotation + 12) % 360
            wait(0.01)
        end
    end)()
end

function LoadingSpinner:willUnmount()
    self.Running = nil
end

function LoadingSpinner:render()

    -- Prepare props
    local props = Support.Merge({}, self.props or {}, {
        [Roact.Ref] = self.instance,
        Image = 'rbxassetid://1932255814',
        AspectRatio = 1
    })

    -- Display component in wrapper
    return new(ImageLabel, props)

end

return LoadingSpinner
--[[--------------------------------------------------------------------
-- Notes:
-- * intended to 'imitate' llex.c code; performance is not a concern
-- * tokens are strings; code structure largely retained
-- * deleted stuff (compared to llex.c) are noted, comments retained
-- * nextc() returns the currently read character to simplify coding
--   here; next() in llex.c does not return anything
-- * compatibility code is marked with "--#" comments
--
-- Added:
-- * luaX:chunkid (function luaO_chunkid from lobject.c)
-- * luaX:str2d (function luaO_str2d from lobject.c)
-- * luaX.LUA_QS used in luaX:lexerror (from luaconf.h)
-- * luaX.LUA_COMPAT_LSTR in luaX:read_long_string (from luaconf.h)
-- * luaX.MAX_INT used in luaX:inclinenumber (from llimits.h)
--
-- To use the lexer:
-- (1) luaX:init() to initialize the lexer
-- (2) luaX:setinput() to set the input stream to lex
-- (3) call luaX:next() or luaX:luaX:lookahead() to get tokens,
--     until "TK_EOS": luaX:next()
-- * since EOZ is returned as a string, be careful when regexp testing
--
-- Not implemented:
-- * luaX_newstring: not required by this Lua implementation
-- * buffer MAX_SIZET size limit (from llimits.h) test not implemented
--   in the interest of performance
-- * locale-aware number handling is largely redundant as Lua's
--   tonumber() function is already capable of this
--
-- Changed in 5.1.x:
-- * TK_NAME token order moved down
-- * string representation for TK_NAME, TK_NUMBER, TK_STRING changed
-- * token struct renamed to lower case (LS -> ls)
-- * LexState struct: removed nestlevel, added decpoint
-- * error message functions have been greatly simplified
-- * token2string renamed to luaX_tokens, exposed in llex.h
-- * lexer now handles all kinds of newlines, including CRLF
-- * shbang first line handling removed from luaX:setinput;
--   it is now done in lauxlib.c (luaL_loadfile)
-- * next(ls) macro renamed to nextc(ls) due to new luaX_next function
-- * EXTRABUFF and MAXNOCHECK removed due to lexer changes
-- * checkbuffer(ls, len) macro deleted
-- * luaX:read_numeral now has 3 support functions: luaX:trydecpoint,
--   luaX:buffreplace and (luaO_str2d from lobject.c) luaX:str2d
-- * luaX:read_numeral is now more promiscuous in slurping characters;
--   hexadecimal numbers was added, locale-aware decimal points too
-- * luaX:skip_sep is new; used by luaX:read_long_string
-- * luaX:read_long_string handles new-style long blocks, with some
--   optional compatibility code
-- * luaX:llex: parts changed to support new-style long blocks
-- * luaX:llex: readname functionality has been folded in
-- * luaX:llex: removed test for control characters
--
--------------------------------------------------------------------]]



local luaZ = require(script.Parent.LuaZ)

local luaX = {}
-- -- -- -- -- -- --
--DIRECTION SCROLL--
-- -- -- -- -- -- --




Elevator:WaitForChild("Direction").Changed:connect(function(val)
    if val == 1 then
		This.Display.ARW1.UP.Transparency = 0
		This.Display.ARW1.MID.Transparency = 0
		This.Display.ARW1.DOWN.Transparency = 0.997
    elseif val == -1 then
		This.Display.ARW1.UP.Transparency = 0.997
		This.Display.ARW1.MID.Transparency = 0
		This.Display.ARW1.DOWN.Transparency = 0
	else
		This.Display.ARW1.UP.Transparency = 0.997
		This.Display.ARW1.MID.Transparency = 0.997
		This.Display.ARW1.DOWN.Transparency = 0.997
    end
end)
-- ROBLOX deviation: config does not have StackTraceConfig type annotation


local function formatPaths(config, relativeTestPath, line: string): string
	-- ROBLOX deviation: we don't do any formatting of paths in Lua to align with upstream
	return line
end

function getStackTraceLines(stack: string, options: StackTraceOptions): { string }
	if options == nil then
		options = { noCodeFrame = false, noStackTrace = false }
	end
	return removeInternalStackEntries(string.split(stack, "\n"), options)
end

function formatStackTrace(stack: string, config, options: StackTraceOptions, testPath): string
	local lines = getStackTraceLines(stack, options)

	local relativeTestPath = nil
	if testPath then
		relativeTestPath = "unsupported"
	end

	local stacktrace = table.concat(
		Array.map(Array.filter(lines, Boolean), function(line)
			return STACK_INDENT .. formatPaths(config, relativeTestPath, trimPaths(line))
		end),
		"\n"
	)

	return string.format("\n%s", stacktrace)
end