What are Exports?
Exports allow other resources on your server to interact with SixM scripts. They’re the recommended way to integrate scripts together.
Using Exports
Client-Side
-- Call an export from another resource
local result = exports['sixm_scriptname']:ExportName(param1, param2)
Server-Side
-- Call a server export
local result = exports['sixm_scriptname']:ServerExportName(source, param1)
Common Export Patterns
Check State
-- Example: check if a player is using the script
local isActive = exports['sixm_scriptname']:IsPlayerActive(source)
if isActive then
print('Player is using the script')
end
Trigger Actions
-- Example: open a UI from another resource
exports['sixm_scriptname']:OpenMenu(source)
Get Data
-- Example: get data from the script
local data = exports['sixm_scriptname']:GetPlayerData(source)
print(data.level, data.experience)
Events
Some scripts also provide events for integration:
Client Events
-- Listen for a script event
RegisterNetEvent('sixm_scriptname:onAction', function(data)
print('Action happened:', data)
end)
Server Events
-- Listen for server-side events
RegisterNetEvent('sixm_scriptname:onServerAction', function(data)
local source = source
print('Player', source, 'triggered action')
end)
Each script documents its own exports and events. Check the specific script documentation or the included README.md for available exports.