registerCommand - Total-RP/Total-RP-3 GitHub Wiki

This allows developers to register their own slash commands

TRP3_API.slash.registerCommand(commandStructure)

Arguments

  • commandStructure: table:
    • id: string, the command itself, usable as /trp3 <id>
    • helpLine: string, what shows up when a user types /help <command>
    • handler: function

Example

Say hello world!

local function helloWorld()
    print("Hello World!")
end

local commandStructure = {
    id = "helloWorld"
    helpLine = "Say hello to the world!"
    handler = function()
        helloWorld()
    end
}

TRP3_API.slash.registerCommand(commandStructure)
⚠️ **GitHub.com Fallback** ⚠️