API reference
Compatibility, conventions and a map of the libraries this reference covers.
Lynx adds a set of global functions and libraries to every script it runs. This reference covers the ones scripts use most: what they take, what they return, and an example you can paste into the editor.
Compatibility
Lynx implements the sUNC, UNC (Unified Naming Convention), Myriad and Synapse X function sets, so scripts written against them run unchanged. On the current build, 100% of the sUNC and 100% of the Myriad test suites pass.
saveinstance and lz4compress.Aliases from older executors, such as http_request, replaceclosure, toclipboard and getexecutorname, are available too. Each function lists its aliases.
Identifying Lynx
Scripts that support several executors can ask which one they're running on:
The second value is the module's own build number, not the app version in the title bar.
Feature detection is usually the better check. It keeps working when a function is added somewhere else:
Conventions
Signatures
Signatures use Luau type syntax. function stands for any function, ...any for any number of values, and a ? marks an optional parameter or a value that may be nil. Functions marked Yields pause the calling thread until they finish.
Errors
Functions raise an error when an argument has the wrong type or an operation fails, such as a missing file or a closed WebSocket. Wrap calls in pcall when failure is expected:
Thread identity
Code you execute runs at identity 8, above any game script. Functions that call back into your code, like hooks, connections and task.spawn, inherit it. See getthreadidentity.
Paths
File functions take paths relative to the workspace folder.
Libraries
Written for Lynx 0.0.0
Something unclear? Tell us on Discord