Skip to content

Instantly share code, notes, and snippets.

@Aloroid
Aloroid / matter_async_hook.luau
Last active January 28, 2023 08:51
This hook allows for developers to execute asynchronous code inside Matter that will return a result at a later time.
local useHookState = Matter.useHookState
local function async<T..., R...>(callback: (T...) -> (R...), discriminator: string?): (T...) -> (boolean, R...)
local existing = useHookState(discriminator, function(existing)
if existing.task then
task.close(existing.task)
end
end)
@Aloroid
Aloroid / Greedymeshing.lua
Created April 26, 2021 06:37
Greedy mesher
--[[
Performs greedy meshing on custom Voxel blocks
made by Megustral
]]
local RunService = game:GetService("RunService")