Skip to content

Roblox Global "Imports" Recreations

Tony Nguyen edited this page May 11, 2020 · 2 revisions

These are the "imported" functions from Roblox's library. "Imported" is in quotation marks since I didn't/couldn't grab Roblox's custom Lua functions, rather I recreated them into Love2D based on how the custom functions behaved and functioned. Since Love2D and Roblox game engines are in different dimensions and have different frameworks, these are NOT perfect replicas of the originals.

A good example is wait(seconds), in Roblox the wait(seconds) function requires only one number argument which indicates how long the thread is yielded for in seconds. However in Love Universe wait(seconds, callback) requires a second argument which is a callback function, in Love2D if the main thread were to be yielded the entire game will freeze, instead wait(seconds, callback) works by creating a Timer and once that timer runs out, the callback will be fired. wait(seconds, callback) is more similar to delay(seconds, callback) in Roblox.

Methods

wait(seconds, callback)

Parameter Type Optional Description
seconds Number Yes The number of sounds to wait for
callback function No Callback to be fired when the timer ends, no arguments are passed

wait(seconds, callback) is the same as delay(seconds, callback)

delay(seconds, callback)

Parameter Type Optional Description
seconds Number Yes The number of sounds to wait for
callback function No Callback to be fired when the timer ends, no arguments are passed

delay(seconds, callback) is the same as wait(seconds, callback)

Work in progress wiki!!

Clone this wiki locally