Jump to content

doesn't add color


manve1

Recommended Posts

Posted

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 
) 

Looking for tutorials or information? check out: www.simpleask.co.uk

Posted
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.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...