executeCommandHandler
Server
Runs the handlers server scripts registered for a command, as if the player had typed it.
Also exists on the client, with its own implementation: executeCommandHandler
bool executeCommandHandler(string commandName, any ... [, element thePlayer = console])
Parameters
| Name | Type | Description |
|---|---|---|
| commandName | string | The command's name. |
| thePlayer | element | The element passed to the handlers as whoever typed it: a player or the console. Pass nil to skip it.default console |
| ... | any | Arguments 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. onPlayerCommand does not fire.
Example
addEventHandler("onPlayerJoin", root, function()
executeCommandHandler("spawn", source)
end)