Bablo ResourcesDocs

Exports

Bablo Map Editor has a small public surface: two exports that return its configuration. There are no exports or events to place props, switch maps on or off, or read maps from another resource. Maps live in the database tables listed on General information.


Exports

Both exports work on the server and on the client.

GetConfig

Returns the Config table as the script uses it. When Config.Framework was left on "auto", it holds the framework that was detected.

LUA
local config = exports['bablo-mapeditor']:GetConfig()
print(config.Command, config.MaxObjectsPerMap)

Called from another resource, the table is a copy. Changing it does not change the script.

GetFramework

Returns the framework the script runs on: 'qbcore', 'qbox' or 'esx'. It returns nil when no framework was found.

LUA
local framework = exports['bablo-mapeditor']:GetFramework()

ensureFolder

The server has one more export, ensureFolder. It is internal: the Publish tab uses it to create the folder of a published resource inside exports/. Don’t call it from other resources.


Events and state

The script has no events that other resources are meant to use.

Every bablo-mapeditor:* event and callback is internal traffic between the script’s own server and client. The server checks the editor rights on every callback that changes something. Don’t trigger them or rely on them.

While a player has the editor open, the script:

  • sets the state bags invBusy and inv_busy of that player to true, and back to false when the editor closes,
  • turns off ox_target for that player, when ox_target runs,
  • freezes the player’s character and makes it unable to be hurt.

Other resources can read the state bags to see that a player is busy in the editor, for example LocalPlayer.state.invBusy on that player’s client or Player(source).state.invBusy on the server.


Open files

The framework files in frameworks/ are escrowed. The script only uses them to find out who is an admin and to read each editor’s character identifier, which their own keys and History entries are saved under. To let more players in, give them the ACE from Config.AcePermission, see Installation.

The files you can open are config.lua, the language files in locales/ with locales/loader.lua, and src/resource/utils/. They are shown in the Script Explorer.