API Reference
Exports
Client, server, and shared export reference with practical Lua examples.
Exports
Overview
Exports are the supported way for another resource to use a No Limit Scripts feature without editing its internals. Start the target resource first, call only documented exports, and guard integrations when a resource may be optional.
Replace `no_limit_script` with the exact installed resource name. An export call can fail even when the code is correct if the resource was renamed.
Client exports
Client exports run in a player client context. Use them for UI actions, local state, and client-side feature requests; do not use them as the only security check.
local opened = exports['no_limit_script']:OpenMenu({ source = 'my_resource' })
if not opened then
print('The menu could not be opened.')
endServer exports
Server exports run on the server and are appropriate for validated actions, server data, and integration checks. Call them from server scripts only.
local allowed, reason = exports['no_limit_script']:CanUseFeature(playerId, 'advanced')
if not allowed then
print(('Player %s was denied: %s'):format(playerId, reason or 'unknown'))
endShared exports
Shared exports are available from both client and server only when the individual product explicitly documents them. Their return values must be safe in both contexts.
local version = exports['no_limit_script']:GetVersion()
print(('No Limit Script version: %s'):format(version))Function signatures
The following signatures illustrate the standard export format used by compatible resources. Check the product README for the exact export list and any version-specific changes.
-- Client: boolean OpenMenu(table options)
exports['no_limit_script']:OpenMenu(options)
-- Server: boolean, string? CanUseFeature(number playerId, string feature)
exports['no_limit_script']:CanUseFeature(playerId, feature)
-- Shared: string GetVersion()
exports['no_limit_script']:GetVersion()Parameters
options— a table of documented optional settings such assourceor an initial view.playerId— the server ID of the player to validate.feature— a documented feature identifier, such asadvanced.
Pass the expected type and never assume omitted fields use a behavior that has not been documented.
Return values
Exports may return a boolean success value, a value plus an optional failure reason, or a data table. Check the first return value before using later values. A nil result usually means the resource was not ready, the export name is unavailable in that version, or the call used the wrong runtime.
Usage examples
-- Optional integration from a server script
if GetResourceState('no_limit_script') == 'started' then
local enabled = exports['no_limit_script']:CanUseFeature(source, 'advanced')
if enabled then
TriggerClientEvent('my_resource:openAdvanced', source)
end
end-- Client-side interaction
RegisterCommand('openfeature', function()
exports['no_limit_script']:OpenMenu({ source = 'command' })
end, false)Notes
Exports are versioned API surfaces, not a substitute for direct database writes or editing resource files. Keep calls behind a small integration module so a future export change is easy to update in one place.
Tips
- Check
GetResourceStatebefore calling an optional resource. - Start dependencies before the resource that calls their exports.
- Validate all player-sensitive actions in a server export or server event.
- Record the resource version when reporting an export issue.
Common mistakes
- Calling a server export from a client script, or the reverse.
- Omitting brackets around a resource name with special characters.
- Treating a failed export call as an authorization success.
- Copying examples without replacing the resource name or feature identifier.
- Editing an escrowed resource to add an export instead of requesting a supported integration.
