- Documentation
- Shared functions
- removeCommandHandler
Function
removeCommandHandler
Removes a command added with addCommandHandler. With a function it removes only that handler; without one it removes every handler of the command.
Syntax
bool removeCommandHandler(string commandName [, function handler])Arguments
commandNamestring- Command name.
handlerfunction, optional- The function to detach.
Returns
true if something was removed.
Example
local function startRace(player)
outputChatBox("Start!", root)
removeCommandHandler("start", startRace)
end
addCommandHandler("start", startRace)