Skip to content

Instantly share code, notes, and snippets.

View MrAsynchronous's full-sized avatar
🐈

Brandon Wilcox MrAsynchronous

🐈
View GitHub Profile
local RunService = game:GetService("RunService")
local Heartbeat = RunService.Heartbeat
local Scheduler = {}
--[[**
Yields the current thread until the specified amount of seconds have elapsed. This uses Heartbeat to avoid using the legacy scheduler.
@param [t:optional<t:numberMin<0>>] Seconds The amount of seconds the thread will be yielded for. Defaults to 0.03.
@returns [t:number] The actual time yielded (in seconds).