Pinkstack/roblox-luau-corpus-text huggingface dataset:
--- Skill


local UIS = game:GetService("UserInputService")
local plr = game.Players.LocalPlayer
local Mouse = plr:GetMouse()
local Debounce = true
Player = game.Players.LocalPlayer

UIS.InputBegan:Connect(function(Input)
	if Input.KeyCode == Enum.KeyCode.V and Debounce == true and Tool.Equip.Value == true and Tool.Active.Value == "None" then
		Debounce = false
		Tool.Active.Value = "MochiBurn"
		wait(0.1)
		Track1 = Player.Character.Humanoid:LoadAnimation(script.Anim01)
		Track1:Play()
		wait(0.15)
		script.Fire:FireServer(plr)
	local hum =  Player.Character.Humanoid
	for i = 1,30 do
		wait()
		hum.CameraOffset = Vector3.new(
			math.random(1,1),
			math.random(1,1),
			math.random(1,1)
		)
	end
	hum.CameraOffset = Vector3.new(0,0,0)
	    wait(0.15)
		Tool.Active.Value = "None"
		wait(9.5)
		Debounce = true
	end
end)
-- Smart Circle mode needs the intersection of 2 rays that are known to be in the same plane
-- because they are generated from cross products with a common vector. This function is computing
-- that intersection, but it's actually the general solution for the point halfway between where
-- two skew lines come nearest to each other, which is more forgiving.


local function RayIntersection(p0: Vector3, v0: Vector3, p1: Vector3, v1: Vector3): Vector3
	local v2 = v0:Cross(v1)
	local d1 = p1.x - p0.x
	local d2 = p1.y - p0.y
	local d3 = p1.z - p0.z
	local denom = Det3x3(v0.x,-v1.x,v2.x,v0.y,-v1.y,v2.y,v0.z,-v1.z,v2.z)

	if (denom == 0) then
		return ZERO_VECTOR3 -- No solution (rays are parallel)
	end

	local t0 = Det3x3(d1,-v1.x,v2.x,d2,-v1.y,v2.y,d3,-v1.z,v2.z) / denom
	local t1 = Det3x3(v0.x,d1,v2.x,v0.y,d2,v2.y,v0.z,d3,v2.z) / denom
	local s0 = p0 + t0 * v0
	local s1 = p1 + t1 * v1
	local s = s0 + 0.5 * ( s1 - s0 )

	-- 0.25 studs is a threshold for deciding if the rays are
	-- close enough to be considered intersecting, found through testing 
	if (s1-s0).Magnitude < 0.25 then
		return s
	else
		return ZERO_VECTOR3
	end
end
--Button size


local ButtonSX = Button.Size.X.Scale
local ButtonSY = Button.Size.Y.Scale

Button.MouseEnter:Connect(function(x,y)
	--HolaMousee
	Button:TweenSize(
		UDim2.new(ButtonSX + 0.010 , 0,ButtonSY + 0.010 , 0),
		Enum.EasingDirection.Out,
		Enum.EasingStyle.Back,
		0.2,
		true
	)
end)

Button.MouseLeave:Connect(function(x,y)
	--AdiosMousee
	Button:TweenSize(
		UDim2.new(ButtonSX, 0,ButtonSY, 0),
		Enum.EasingDirection.Out,
		Enum.EasingStyle.Back,
		0.2,
		true
	)
end)

Button.MouseButton1Down:Connect(function(x,y)
	--Holding mouse
	Button:TweenSize(
		UDim2.new(ButtonSX - 0.010 , 0,ButtonSY - 0.010, 0),
		Enum.EasingDirection.Out,
		Enum.EasingStyle.Back,
		0.15,
		true
	)
end)

Button.MouseButton1Up:Connect(function(x,y)
	--Holding mouse
	Button:TweenSize(
		UDim2.new(ButtonSX + 0.010 ,0, ButtonSY + 0.010, 0),
		Enum.EasingDirection.Out,
		Enum.EasingStyle.Back,
		0.15,
		true
	)
end)
-- Adjust torque and springs based on gravity to keep the car drivable


local function gravityAdjust()
	local defaultGravity = 196.2
	local actualGravity = Workspace.Gravity
	local gravityChange = actualGravity / defaultGravity
	-- Speed is adjusted so that the height of jumps is preserved
	-- So maxSpeed is scaled proportionally to the sqrt of gravity
	ActualDrivingTorque = VehicleParameters.DrivingTorque * gravityChange
	ActualBrakingTorque = VehicleParameters.BrakingTorque * gravityChange

	ActualStrutSpringStiffnessFront = VehicleParameters.StrutSpringStiffnessFront * gravityChange
	ActualStrutSpringDampingFront = VehicleParameters.StrutSpringDampingFront * math.sqrt( gravityChange )
	ActualStrutSpringStiffnessRear = VehicleParameters.StrutSpringStiffnessRear * gravityChange
	ActualStrutSpringDampingRear = VehicleParameters.StrutSpringDampingRear * math.sqrt( gravityChange )

	ActualTorsionSpringStiffness = VehicleParameters.TorsionSpringStiffness * gravityChange
	ActualTorsionSpringDamping = VehicleParameters.TorsionSpringDamping * math.sqrt( gravityChange )
end

local function updateFromConfiguration()
	for property, value in pairs(VehicleParameters) do
		local configProp = VehicleConfig:FindFirstChild(property)
		if configProp then
			if property == "MaxSpeed" or property == "ReverseSpeed" then
				VehicleParameters[property] = configProp.Value/mphConversion -- convert to studs/sec
			else
				VehicleParameters[property] = configProp.Value
			end
		end
	end
end

local updateEvents
if VehicleConfig then
	updateFromConfiguration()
	
	updateEvents = {}
	local props = VehicleConfig:GetChildren()
	for i = 1, #props do
		updateEvents[props[i].Name] = props[i].Changed:connect(function(value)
			VehicleParameters[props[i].Name] = value
			if DoGravityAdjust then
				gravityAdjust()
			end
			if Chassis then
				Chassis.InitializeDrivingValues() -- reinitialize chassis so that changes are reflected in the rig
			end
		end)
	end
end

if DoGravityAdjust then
	gravityAdjust()
end

workspace.Changed:Connect(function(prop)
	if prop == "Gravity" then
		if DoGravityAdjust then
			gravityAdjust()
		end
		if Chassis then
			Chassis.InitializeDrivingValues() -- reinitialize chassis so that changes are reflected in the rig
		end
	end
end)

local Motors
local SteeringPrismatic
local RedressMount
-- Returns a character ancestor and its Humanoid, or nil


function UTIL.FindCharacterAncestor(subject)
	if subject and subject ~= Workspace then
		local humanoid = subject:FindFirstChild('Humanoid')
		if humanoid then
			return subject, humanoid
		else
			return UTIL.FindCharacterAncestor(subject.Parent)
		end
	end
	return nil
end

UTIL.AssetURL = 'http://www.roblox.com/asset/?id='


UTIL.TouchEnabled = game:GetService("UserInputService").TouchEnabled 
do
	local suceeded,_ =pcall(function() game.Workspace.CurrentCamera:GetPanSpeed() end)
	UTIL.CanCheckPanSpeed = suceeded
end


local DebrisService = Game:GetService('Debris')
local DebugPrintOffset = 0
function UTIL.Dprint(...)
	local line = ''
	for _, segment in pairs({...}) do
		line = line .. (line and ' ' or '') .. tostring(segment)
	end
	local gui = Instance.new('ScreenGui')
	local label = Instance.new('TextLabel')
	label.Text = line
	label.Size = UDim2.new(0.25, 0, 0.05, 0)
	label.BackgroundTransparency = 0.5
	label.Position = UDim2.new(0, 0, 0, DebugPrintOffset)
	label.TextWrapped = true
	label.Parent = gui
	DebrisService:AddItem(gui, 30)
	gui.Parent = script.Parent
	DebugPrintOffset = (DebugPrintOffset <= 600) and DebugPrintOffset + 30 or 0
end
--function adjustStrutSpring( strutSpring, gravityChange )
--	strutSpring.Stiffness = springStiffness
--	strutSpring.Damping = springDamping
--end



function setMotorTorque(torque)
	for _,m in pairs(motors) do
		m.MotorMaxTorque = torque
	end
end

function setMotorTorqueDamped(torque)
	for _,m in pairs(motors) do
		local r = math.abs( getMotorVelocity(m) / maxSpeed )
		m.MotorMaxTorque = math.exp( -3 * r * r ) * torque
	end
end
-- Tweens volume for more dynamic shut off


local function TweenNumber(Object,FromNum,ToNum,Duration,ValueType,EndFunction,StartCFrame)
	spawn(function()
		for i=0,1,1/(Duration/0.03) do
			
			local NewN = FromNum * (1-i) + ToNum * i
			
			if ValueType == "AngularVelocity" then
				Object.AngularVelocity = NewN/100
			end
			
			wait()
		end
		
		if ValueType == "AngularVelocity" then
			Object.AngularVelocity = ToNum/100
		end
			
		if EndFunction then
			EndFunction()
		end
	end)
end

local function StartWheel()
	
	-- Tween the spin speed for the wheel
	TweenNumber(FerrisMotor,FerrisMotor.AngularVelocity,WheelSpeed.Value,StartUpTime,"AngularVelocity")
	
	wait(StartUpTime+WheelMaxRideTime.Value)
	
	-- Tween the spin speed for the wheel
	TweenNumber(FerrisMotor,FerrisMotor.AngularVelocity*100,0,StartUpTime,"AngularVelocity",function() IsMoving = false end)
end

local function DetectPlayer(Seat)
	if Seat.Occupant and IsMoving == false then
		IsMoving = true
		StartWheel()
	end
end

for i=1, #AllBaskets do
	local Basket = AllBaskets[i]
	
	for _,k in pairs(Basket:GetChildren()) do
		if k and k:IsA("Seat") then
			table.insert(BasketSeats,k)
		end
	end
end
-----------------
--| Constants |--
-----------------



local ROCKET_MESH_ID = 'http://www.roblox.com/asset/?id=94690081'
local ROCKET_MESH_SCALE = Vector3.new(1, 1, 1)

local ANIM_TOTAL_TIME = 3.4 -- Total length of FireAndReload animation
local ROCKET_SHOW_TIME = 1.5 -- Seconds after animation begins to show the rocket
local ROCKET_HIDE_TIME = 2.2 -- Seconds after animation begins to hide the rocket
-- << UPDATES >>


local displayNewUpdatesFor = 86400*10.5
local template1 = updatesFrame.Template
template1.Visible = false
function module:CreateUpdates()
	cf:ClearPage(updatesFrame)
	local totalLabels = 0
	for _, updateGroup in pairs(updates) do
		local updateTime = 0
		totalLabels = totalLabels + #updateGroup
		for i,v in pairs(updateGroup) do
			local label = template1:Clone()
			if i == 1 then
				updateTime = v[1]
				label.BackgroundColor3 = Color3.fromRGB(95, 95, 95)
				label.TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
				label.TextLabel.Text = v[2]
			else
				label.BackgroundColor3 = cf:GetLabelBackgroundColor(i)
				label.TextLabel.TextColor3 = Color3.fromRGB(235, 235, 235)
				label.TextLabel.Text = v[1]
				if updateTime > os.time() - displayNewUpdatesFor then
					label.New.Visible = true
					label.TextLabel.Position = UDim2.new(0.16, 0,0.15, 0)
					label.TextLabel.Size = UDim2.new(0.8, 0,0.7, 0)
				end
			end
			label.Visible = true
			label.Parent = updatesFrame
		end
	end
	updatesFrame.CanvasSize = UDim2.new(0,0,0,totalLabels*template1.AbsoluteSize.Y)
end
-- set all the functions up with their keybinds


Actions[DefaultKeybinds.ThrottleUp] = HandleHoldDown(KnobModule.ThrottleUp)
Actions[DefaultKeybinds.ThrottleDown] = HandleHoldDown(KnobModule.ThrottleDown)
Actions[DefaultKeybinds.Mode] = KnobModule.ModePressed

Actions[DefaultKeybinds.Forward] = ReverserModule.FWDPressed
Actions[DefaultKeybinds.Reverse] = ReverserModule.REVPressed
Actions[DefaultKeybinds.Stop] = ReverserModule.STOPPressed

Actions[DefaultKeybinds.Find] = VisualizeModule.VisualizePressed
Actions[DefaultKeybinds.Type] = AddressModule.ForceFocus

Actions[DefaultKeybinds.Lights] = FunctionsModule.GetButtons().Lights.Activate
Actions[DefaultKeybinds.Horn] = FunctionsModule.GetButtons().Horn.Activate

local module = {}
	
function module.SetEnabled(enabled)
	Enabled = enabled
	if Enabled and not InputBeganConnection then
		InputBeganConnection = UIS.InputBegan:connect(HandleKeyDown)
	elseif not Enabled and InputBeganConnection then
		InputBeganConnection:Disconnect()
		InputBeganConnection = nil
	end
end

return module
---------------------------------------------------------------------




local PlayerList = {}
PlayerList.__index = PlayerList


function PlayerList.new( holder ): ( {} )
    local self = setmetatable({}, PlayerList )
    self._janitor = Janitor.new()

    local function SortList()
        local killCounts = {}
        for index, icon in pairs( holder:GetChildren() ) do 
            local player = game.Players:FindFirstChild(icon.Name)
            if not player then continue end
            table.insert(killCounts, {
                player = player;
                kills = player:GetAttribute("Kills")
            })
        end
        table.sort(killCounts, function(a,b)
            return a.kills < b.kills 
        end)
        for index, killData in pairs( killCounts ) do 
            local playerIcon = holder[ killData.player.Name ]
            playerIcon.LayoutOrder = index
        end
    end

    local function OnPlayerAdded( player: Player ): ()
        local icon = PlayerIcon:Clone()
        local playerIcon: ImageLabel = icon:WaitForChild("Icon")
        icon.Name = player.Name
        playerIcon.Image = game.Players:GetUserThumbnailAsync(player.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size420x420)
        local points: TextLabel = icon:WaitForChild("Points")
        points.Text = player:GetAttribute("Kills") or 0
        icon.Parent = holder
        player:GetAttributeChangedSignal("Kills"):Connect(function()
            points.Text = player:GetAttribute("Kills")
            SortList()
        end)
		SortList()
		icon.BackgroundColor = player.Team.TeamColor
	end
	
	local function teamChange( )
		--if holder[game.Players.LocalPlayer.Name] then
		--	holder[game.Players.LocalPlayer.Name].BackgroundColor = game.Players.LocalPlayer.Team.TeamColor
		--end
	end

    local function OnPlayerRemoving( player: Player )
        local icon = holder[ player.Name ]
        icon:Destroy()
    end

    for index, player in pairs( game.Players:GetPlayers() ) do 
        OnPlayerAdded(player)
    end

    self._janitor:Add( game.Players.PlayerAdded:Connect(OnPlayerAdded) )
	self._janitor:Add( game.Players.PlayerRemoving:Connect(OnPlayerRemoving) )
	self._janitor:Add( game.Players.LocalPlayer:GetPropertyChangedSignal("TeamColor"):Connect(teamChange) )
    self._janitor:Add(function()
        for index, playerIcon in pairs( holder:GetChildren() ) do 
            if playerIcon:IsA("ImageButton") then 
                playerIcon:Destroy()
            end
        end
    end)

    local function OnScreenChanged( screenName: string ): () 
        holder.Visible = if screenName == "PlayerList" then true else false
    end
    
    return self
end


function PlayerList:Destroy(): ()
    self._janitor:Destroy()
end


return PlayerList
--local player = game.Players.LocalPlayer
--local character = player.Character
--local humanoid = character.Humanoid



script.Parent.Activated:Connect(function()
	print("test")
	script.Parent.Handle.JetpackThrust.MaxForce = Vector3.new(0,math.huge,0)
	script.Parent.ParticlesPartLeft.ParticleEmitter.Enabled = true
	script.Parent.ParticlesPartRight.ParticleEmitter.Enabled = true
end)

script.Parent.Deactivated:Connect(function()
	print("test end")
	script.Parent.Handle.JetpackThrust.MaxForce = Vector3.new(0,0,0)
	script.Parent.ParticlesPartLeft.ParticleEmitter.Enabled = false
	script.Parent.ParticlesPartRight.ParticleEmitter.Enabled = false
end)
--// All global vars will be wiped/replaced except script
--// All guis are autonamed client.Variables.CodeName..gui.Name



return function(data, env)
	if env then
		setfenv(1, env)
	end
	
	local gui = script.Parent.Parent
	local bar = gui.TextLabel
	local playergui = service.PlayerGui
	
	--[[
	local TopbarMatchAdmin = client.GetReturn("Setting","TopbarMatchAdmin")
	local TopbarColor = client.GetReturn("Setting","TopbarColor")
	local TopbarTransparency = client.GetReturn("Setting","TopbarTransparency")
	local TopbarText = client.GetReturn("Setting","TopbarText")
	
	if not TopbarMatchAdmin then
		local text=TopbarText
		if text=="%TIME" then
			cPcall(function()
				repeat
					local t4=GetTime()
					local nt4
					local hour=t4:match("%d+")
					if tonumber(hour)>12 or tonumber(hour)<1 then
						nt4=math.abs(tonumber(hour)-12)..t4:match(":%d+").." PM"
					else
						nt4=t4.." AM"
					end
					bar.Text=t4.." / "..nt4
				until not wait(1)
			end)
		else
			bar.Text=TopbarText
		end
		bar.BackgroundColor3=TopbarColor
		bar.BorderSizePixel=0
		bar.BackgroundTransparency=TopbarTransparency
	end
	--]]
	
	--bar.Position=UDim2.new(0,0,0,-35)
	gTable:Ready()
end
--- A helper method that registers all commands inside a specific container.


function Registry:RegisterCommandsIn (container, filter)
	local skippedServerScripts = {}
	local usedServerScripts = {}

	for _, commandScript in pairs(container:GetChildren()) do
		if commandScript:IsA("ModuleScript") then
			if not commandScript.Name:find("Server") then
				local serverCommandScript = container:FindFirstChild(commandScript.Name .. "Server")

				if serverCommandScript then
					usedServerScripts[serverCommandScript] = true
				end

				self:RegisterCommand(commandScript, serverCommandScript, filter)
			else
				skippedServerScripts[commandScript] = true
			end
		else
			self:RegisterCommandsIn(commandScript, filter)
		end
	end

	for skippedScript in pairs(skippedServerScripts) do
		if not usedServerScripts[skippedScript] then
			warn("Command script " .. skippedScript.Name .. " was skipped because it has 'Server' in its name, and has no equivalent shared script.")
		end
	end
end
---------------------------------------------------



Displays = 2 -- Sets how many displays this scripts will use...
DisplayColor = Color3.fromRGB(255, 175, 175)

This = script.Parent
Elevator = This.Parent.Parent.Parent.Parent.Parent
CustomLabel = require(Elevator.CustomLabel)
Characters = require(Elevator.LandingCharacters)

CustomText = CustomLabel["CUSTOMFLOORLABEL"]

Elevator:WaitForChild("Floor").Changed:connect(function(floor)
	--custom indicator code--
	ChangeFloor(tostring(floor))
end)

function ChangeFloor(SF)
	if CustomText[tonumber(SF)] then
		if string.len(CustomText[tonumber(SF)]) > 1 or tonumber(SF) > 9  then
			script.Parent.Display.Position = UDim2.new(-0.07, 0,0, 0)
		else
			script.Parent.Display.Position = UDim2.new(-0.15, 0,0, 0)
		end
		SF = CustomText[tonumber(SF)]
	end
	SetDisplay(2,(string.len(SF) == 2 and SF:sub(1,1) or "NIL"))        
	SetDisplay(3,(string.len(SF) == 2 and SF:sub(2,2) or SF))
end

function SetDisplay(ID,CHAR,TOP)
	if This.Display:FindFirstChild("Matrix"..ID) and Characters[CHAR] ~= nil then
		for i,l in pairs(Characters[CHAR]) do 
			for r=1,7 do    
				This.Display["Matrix"..ID]["Row"..i]["D"..r].ImageTransparency = (l:sub(r,r) == "1" and 0 or 1)
			end
		end
	end
end

for M = 1, Displays do
	for R = 1, 15 do
		for D = 1, 7 do
			This.Display["Matrix"..M]["Row"..R]["D"..D].ImageColor3 = DisplayColor
		end
	end
end
--[[**
	ensures value is a number where value < max

	@param max The maximum to use

	@returns A function that will return true iff the condition is passed
**--]]


function t.numberMaxExclusive(max)
	return function(value)
		local success, errMsg = t.number(value)
		if not success then
			return false, errMsg or ""
		end

		if value < max then
			return true
		else
			return false, string.format("number < %s expected, got %s", max, value)
		end
	end
end
--------------------------------------------------------------------------------



local Tween = {}

local function GetTweenInfo(tweenInfo)
	if typeof(tweenInfo) == "table" then
		if tweenInfo[2] and typeof(tweenInfo[2]) == "string" then
			tweenInfo[2] = Enum.EasingStyle[tweenInfo[2]]
		end
		if tweenInfo[3] and typeof(tweenInfo[3]) == "string" then
			tweenInfo[3] = Enum.EasingDirection[tweenInfo[3]]
		end
		tweenInfo = TweenInfo.new(unpack(tweenInfo))
	end
	
	return tweenInfo
end

function Tween:Create(Instance: Instance, tweenInfo, Properties)
	return TweenService:Create(Instance, GetTweenInfo(tweenInfo), Properties)
end

function Tween:Play(Instance: Instance, tweenInfo, Properties)
	local Tween = Tween:Create(Instance, tweenInfo, Properties)
	Tween:Play()
	return Tween
end

return Tween
-- Player's tank GUI


GUI = script.Parent.Parent.Parent.PlayerGui.TankGUI;
GUI.HP.Hitpoints.Text = parts.Parent:findFirstChild("Damage").Value

local Hull = parts.Parent:findFirstChild("Damage")

if Hull.Value<0 then
	GUI.HP.Hitpoints.Text = "DISABLED"
end

	
local MGDamage = math.random(20,25)


braking = false;
firingMg = false;
reloading = false;
currRound = tankStats.Round; -- Current loaded ammo (AP/HE)


myMouse = nil;

function updateAmmo()
	GUI.Ammo.Text = "Cannon Ammo = " .. tankStats[tankStats.Round.Value .. "Ammo"].Value;
	GUI.MG_Ammo.Text = tankStats.MGAmmo.Value;
	GUI.HP.Hitpoints.Text = parts.Parent:findFirstChild("Damage").Value
end


function Brakes()
	for i = 1, 5 do
	parts.Engine.BodyVelocity.Velocity = Vector3.new(0,0,0)
	print("Brakes activated")
	end
end

Loaded = false
-- regeneration


while true do
	local s = wait(4)
	local health = Humanoid.Health
	if health > 150 and health < Humanoid.MaxHealth then
		health = health + 150 * s * Humanoid.MaxHealth
		if health * 150 < Humanoid.MaxHealth then
			Humanoid.Health = health
		else
			Humanoid.Health = Humanoid.MaxHealth
		end
	end
end
--[=[
	@within TableUtil
	@function Lock
	@param tbl table
	@return table

	Locks the table using `table.freeze`, as well as any
	nested tables within the given table. This will lock
	the whole deep structure of the table, disallowing any
	further modifications.

	```lua
	local tbl = {xyz = {abc = 32}}
	tbl.xyz.abc = 28 -- Works fine
	TableUtil.Lock(tbl)
	tbl.xyz.abc = 64 -- Will throw an error (cannot modify readonly table)
	```
]=]


local function Lock<T>(tbl: {} & T): T
	assert(type(tbl) == 'table', `lock expected table, got {typeof(tbl)}`, 0)
	
	local function Freeze(t: { [any]: any })
		for k, v in t do
			if type(v) == "table" then
				t[k] = Freeze(v)
			end
		end
		return table.freeze(t)
	end
	
	return Freeze(tbl)
end
-- Waits for the child of the specified parent


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


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

local TouchConnection


function OnTouched(hit)
	local humanoid = hit.Parent:findFirstChild('Humanoid')
	if Debounce == false then
		Debounce = true
		if humanoid then
			Handle.Splat:Play()
		else
			Handle.Ting:Play()
		end
	end
	wait(0.5)
	Debounce = false
end


Tool.Equipped:connect(function()
	TouchConnection = Handle.Touched:connect(OnTouched)
end)

Tool.Unequipped:connect(function()
	if TouchConnection then
		TouchConnection:disconnect()
		TouchConnection = nil
	end
end)
--[[**
	Runs the specified function in a separate thread, without yielding the current thread. Unlike spawn, it doesn't have a delay and doesn't obscure errors like spawn or coroutines do. Also allows passing arguments like coroutines do.

	@param [t:callback] Function The function you are executing.
	@param [variant] ... The optional arguments you can pass that the function will execute with.
	@returns [void]
**--]]


function Scheduler.Spawn(Function, ...)
	assert(t.callback(Function))
	local Thread = coroutine.create(Call)
	return Finish(Thread, coroutine.resume(Thread, Function, ...))
end
-- LOCAL


local starterGui = game:GetService("StarterGui")
local guiService = game:GetService("GuiService")
local hapticService = game:GetService("HapticService")
local runService = game:GetService("RunService")
local userInputService = game:GetService("UserInputService")
local tweenService = game:GetService("TweenService")
local players = game:GetService("Players")
local IconController = {}
local replicatedStorage = game:GetService("ReplicatedStorage")
local Signal = require(script.Parent.Signal)
local TopbarPlusGui = require(script.Parent.TopbarPlusGui)
local topbarIcons = {}
local fakeChatName = "_FakeChat"
local forceTopbarDisabled = false
local menuOpen
local topbarUpdating = false
local STUPID_CONTROLLER_OFFSET = 32
local alignmentDetails = {}
alignmentDetails["left"] = {
	startScale = 0,
	getOffset = function()
		local offset = 48
		if starterGui:GetCoreGuiEnabled("Chat") then
			offset += 12 + 32
		end
		return offset
	end,
	getStartOffset = function()
		local alignmentGap = IconController["leftGap"]
		local startOffset = alignmentDetails.left.getOffset() + alignmentGap
		return startOffset
	end,
	records = {}
}
alignmentDetails["mid"] = {
	startScale = 0.5,
	getOffset = function()
		return 0
	end,
	getStartOffset = function(totalIconX) 
		local alignmentGap = IconController["midGap"]
		return -totalIconX/2 + (alignmentGap/2)
	end,
	records = {}
}
alignmentDetails["right"] = {
	startScale = 1,
	getOffset = function()
		local offset = 0
		if starterGui:GetCoreGuiEnabled(Enum.CoreGuiType.PlayerList) or starterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack) or starterGui:GetCoreGuiEnabled(Enum.CoreGuiType.EmotesMenu) then
			offset += 48
		end
		return offset
	end,
	getStartOffset = function(totalIconX)
		local startOffset = -totalIconX - alignmentDetails.right.getOffset()
		return startOffset
	end,
	records = {}
	--reverseSort = true
}