Exports
With these exports, you will be able to manipulate the system from scripts external to it.
Client Exports
AddMessage
exports.origen_chat:addMessage(message)message:
tableargs:
tableorstringtitle?:
stringbarColor?:
stringor[number, number, number]type?:
string(error, warning, info, success, debug)timestap?:
stringicon?:
string
Example:
exports.origen_chat:addMessage({
args = {'Test message'},
barColor = '#00FF00',
type = 'info',
title = 'INFO',
timestamp = "13:00",
icon = 'lucide:info'
})AddSuggestion
exports.origen_chat:addSuggestion(name, help, params)name:
stringhelp:
stringparams:
tablename:
stringhelp:
stringdisasbled:
boolean
Example:
exports.origen_chat:addSuggestion('test_command', 'Test description', {
{
name = 'player',
help = 'The player to greet',
disabled = false
},
{
name = 'message',
help = 'The message to send',
disabled = false
}
}, false)RemoveSuggestion
exports.origen_chat:removeSuggestion(name)name:
string
Example:
exports.origen_chat:removeSuggestion('test_command')Server Exports
AddMessage
exports.origen_chat:addMessage(target, message)target:
numbermessage:
tableargs:
tableorstringtitle?:
stringbarColor?:
stringor[number, number, number]type?:
string(error, warning, info, success, debug)timestap?:
stringicon?:
string
Example:
exports.origen_chat:addMessage(1, {
args = {'Test message'},
barColor = '#00FF00',
type = 'info',
title = 'INFO',
timestamp = "13:00",
icon = 'lucide:info'
})RegisterCommand
exports.origen_chat:registerCommand(config, callback)config:
tablecommand:
stringhelp:
stringparams?:
tablename:
stringtype?:
string(number, text, player, longText)help:
stringoptional?:
boolean
permissions?:
tableorstring
callback:
functionsource:
numberargs:
tableraw:
string
Example:
exports.origen_chat:registerCommand({
command = 'command_name',
help = 'Command description',
params = {
{
name = 'arg1',
type = 'number',
help = 'Number argument',
},
{
name = 'arg2',
type = 'text',
help = 'Text argument',
optional = true,
},
{
name = 'arg3',
type = 'player',
help = 'Player argument',
},
{
name = 'arg4',
type = 'longText',
help = 'Long text argument',
},
},
permissions = {
'admin',
'mod',
},
}, function(source, args, raw)
local arg1 = args.arg1
local arg2 = args.arg2
local arg3 = args.arg3
local arg4 = args.arg4
print(arg1, arg2, arg3, arg4)
end)Last updated