function Scheduler.Delay(Q,I,...)assert(DelayTuple(Q,I))local Z=select("\035",...)if Z>0 then local O={...}local R=tick()+Q local r r=Heartbeat:Connect(function()if tick()>=R then r:Disconnect()I(table.unpack(O,1,Z))end end)return r else local Z=tick()+Q local O O=Heartbeat:Connect(function()if tick()>=Z then O:Disconnect()I()end end)return O end end
--[[**
	Schedules a function to be executed after DelayTime seconds have passed, without yielding the current thread. This function allows multiple Lua threads to be executed in parallel from the same stack. Unlike regular delay, this does not use the legacy scheduler and also allows passing arguments.

	@param [t:numberMin<0>] DelayTime The amount of time before the function will be executed.
	@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.Delay(DelayTime, Function, ...)
	assert(DelayTuple(DelayTime, Function))
	local Length = select("#", ...)
	if Length > 0 then
		local Arguments = { ... }
		local ExecuteTime = tick() + DelayTime
		local Connection

		Connection = Heartbeat:Connect(function()
			if tick() >= ExecuteTime then
				Connection:Disconnect()
				Function(table.unpack(Arguments, 1, Length))
			end
		end)

		return Connection
	else
		local ExecuteTime = tick() + DelayTime
		local Connection

		Connection = Heartbeat:Connect(function()
			if tick() >= ExecuteTime then
				Connection:Disconnect()
				Function()
			end
		end)

		return Connection
	end
end
