Skip to content

Lua scripting ​

Game modes and server features are Lua resources that the server runs and that act on the game only through the dlmp API. These pages are the contract resource authors rely on:

PageWhat it covers
ResourcesThe resource folder, the resource.toml manifest, dependencies, require and dlmp.import, client files, storage, and start, stop, reload and shutdown
ElementsElement families, ownership, handles, players, and events whose source was removed
Events, commands and timersSubscribing to events, their order and refusal, player and console commands, timers
Errors and the sandboxnil, err versus raised errors, errors in callbacks, the libraries, the time limit and what a resource cannot reach

The function-by-function API reference is built from resources/.types/dlmp.lua, a type stub for Lua language servers that editors read for completion and checks. The shipped resources in resources/ are working examples, and the guides walk through parts of them. Decisions behind the API are in the architecture decisions; what crosses the wire is in the protocol.

Documentation licensed under CC BY 4.0. DarqlineMP is not affiliated with Rockstar Games or Take-Two Interactive. Grand Theft Auto is a trademark of Take-Two Interactive Software, Inc.