addEventHandler ( "onPlayerChat", root,
function ( txt )
local txt = txt:gsub ( "#[%x][%x][%x][%x][%x][%x]", "" )
local len = 0
if ( txt:len ( ) > 48 ) then
return
end
if ( txt:find ( "hey chuck" ) ) then
local text = txt:gsub ( "hey chuck", "" )
setTimer (
outputChatBox,
100,
1,
"#FF00FF|NcO|#FFFF00Chuck: Hey!",
source,
255,
255,
0,
true
)
end
end
)
Should work.
The problem was that you created another function for the timer, instead of using just 'outputChatBox', so 'source' was not defined.