manve1 Posted September 12, 2012 Share Posted September 12, 2012 it doesn't add colors if i do #FF00FF or #FFFF00 ect .. i think you get the point addEventHandler("onPlayerChat", root, function (txt) txt = string.gsub(txt,"#[%x][%x][%x][%x][%x][%x]","") local len = 0 if string.len(txt) > 48 then return end if string.find(txt, "hey chuck") then local text = string.gsub(txt,"hey chuck","") setTimer( function() outputChatBox("#FF00FF|NcO|#FFFF00Chuck: Hey!", source, 255, 255, 0, true) end, 100, 1 ) end end ) Link to comment
Castillo Posted September 12, 2012 Share Posted September 12, 2012 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. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now