Items
Provides a way to register and trigger usable item logic server-side. This module allows developers to define behaviour when an item is used in-game.
Accessing the Module
Server
register_item(item_id, use_function)
Registers an item as usable. When the item is used, the callback function will be invoked with the source and item ID.
Parameters
Name
Type
Description
item_id
string
The item identifier
use_function
function
The function to call on item usage
Example
use_item(source, item_id)
Triggers a previously registered usable item for the player.
Parameters
Name
Type
Description
source
number
The player source identifier
item_id
string
The item identifier to use
Example
Last updated