M MY Multiplayer: Wiki
Side
Kind

executeCommandHandler

Client

Runs the handlers client scripts registered for a command, as if it had been typed.

Also exists on the server, with its own implementation: executeCommandHandler

bool executeCommandHandler(string commandName, any ...)

Parameters

NameTypeDescription
commandNamestringThe command's name.
...anyArguments passed to the handlers, each turned into a string.

Returns

true if a running resource handled the command, false if none did.

It runs every resource's handlers, not only this one's. The command is not sent to the server.

Example

addCommandHandler("zoom", function(command, level)
    outputDebugString("zoom " .. tostring(level))
end)

executeCommandHandler("zoom", 2)

See also