This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --!strict | |
| local Connections = {} | |
| Connections.__index = Connections | |
| type Connection = RBXScriptConnection | |
| type ConnectionsData = { | |
| Connections: {Connection}, | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --!strict | |
| return function(ParentObject: Instance, TargetClassName: string): Instance | |
| local FoundChild = ParentObject:FindFirstChildOfClass(TargetClassName) | |
| while not FoundChild do | |
| ParentObject.ChildAdded:Wait() | |
| FoundChild = ParentObject:FindFirstChildOfClass(TargetClassName) | |
| end | |
| return FoundChild | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --!strict | |
| local Epsilon = 0.001 | |
| return function(Alpha: number, Midpoint: number): number | |
| Midpoint = math.clamp(Midpoint, Epsilon, 1 - Epsilon) | |
| Alpha = math.clamp(Alpha, 0, 1) | |
| local function CalculateIncreasing(): number | |
| return 1 - 2 ^ (-10 * Alpha / Midpoint) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --!strict | |
| return function(...: (...any) -> ...any): ...any | |
| local CurrentThread = coroutine.running() | |
| local HasResumed = false | |
| local CaughtError | |
| local function ResumeThread(...: any) | |
| if HasResumed then | |
| return |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --!strict | |
| local function SetSequentialInterval(CallbackFunction: (number, ...any) -> (), IntervalDuration: number, ...: any): () -> () | |
| local IsCleared = false | |
| local function ExecuteCallback(ScheduledTimestamp: number, ...: any) | |
| if IsCleared then | |
| return | |
| end | |
| local TimeDelta = os.clock() - ScheduledTimestamp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --!strict | |
| local MaximumDepth = 4 | |
| local IndentString = " " | |
| local function FormatValue(Value: any, CurrentDepth: number, IsKey: boolean?): string | |
| CurrentDepth = CurrentDepth or 0 | |
| if CurrentDepth >= MaximumDepth then | |
| return "{ ... }" | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --!strict | |
| type ExecutableFunction = (...any) -> ...any | |
| export type Handler = (...any) -> (boolean, ...any) | |
| local function RetryAsync(Func: ExecutableFunction, MaximumAttempts: number, PauseConstantValue: number?, PauseExponentValue: number?, CustomHandler: Handler?): (boolean, ...any) | |
| local PauseConstant: number = PauseConstantValue or 0 | |
| local PauseExponent: number = PauseExponentValue or 0 | |
| local ExecutionHandler: Handler = CustomHandler or pcall | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --!strict | |
| type Pages = { | |
| GetCurrentPage: (self: Pages) -> { { KeyName: any } }, | |
| AdvanceToNextPageAsync: (self: Pages) -> (), | |
| IsFinished: boolean, | |
| } | |
| return function(PagesObject: Pages): () -> (any, number) | |
| return coroutine.wrap(function() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --!strict | |
| type CallbackFunction = (...any) -> ...any | |
| local function HandleResult(Thread: thread, Success: boolean, ...: any): ...any | |
| if not Success then | |
| error(debug.traceback(Thread, (...)), 2) | |
| end | |
| if coroutine.status(Thread) == "dead" then | |
| error("Do not yield inside a changing event") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --!strict | |
| local Players = game:GetService("Players") | |
| return function(OnPlayerAddedCallback: (Player) -> nil) | |
| local ProcessedPlayers = {} | |
| local function SafeCallback(Player) | |
| if not ProcessedPlayers[Player] then | |
| ProcessedPlayers[Player] = true | |
| OnPlayerAddedCallback(Player) |