We've always recommended _not_ using onConsole for this. addCommandHandler is both easier and more secure as you can easily secure console commands from being used through the ACL, plus write much less code.
This is a very silly way to do it.
Your code:
function input_Console ( text )
local command = gettok (text, 1, 32 )
if ( command == "my" ) then
local playerName = getPlayerName ( source )
local actionText = string.sub ( text, 3 )
outputChatBox ( " *" .. playerName .. "'s" .. actionText .. " ", root, 255, 40, 80, true )
end
end
addEventHandler ( "onConsole", getRootElement(), input_Console )
How it should be done:
function myCommand( playerSource, commandName, ...)
local actionText = table.concat( arg, " " )
local playerName = getPlayerName ( playerSource )
outputChatBox ( " *" .. playerName .. "'s" .. actionText .. " ", root, 255, 40, 80, true )
end
addCommandHandler("my", myCommand)