@name Private Chat
@persist [Chat]:gtable [ChatKey Said]:string [TextCollor]:vector Me:entity 
if (first()|duped()) {
    ChatKey="/"
    Chat=gTable("Chats",1) 
    TextCollor=vec(255,255,255)
    printColor(vec(255,255,255),"\n"+"# Welcome to Sabreman's personal comunications chip!")
    printColor(vec(200,0,0),"# Type .ch followed by a channel name to switch channels. ")
    printColor(vec(200,150,0),"# Type .col followed by a 3 digit color code seperated by spaces to swich colors or type .col random for a random color.")
    printColor(vec(154,79,30),"# Type .list to get a lsit of players using this E2.")
    printColor(vec(150,250,0),"# Type "+ChatKey+" followed by your messege to chat.")
    printColor(vec(0,250,150),"# To modify the chat key, open the E2."+"\n")}
    
runOnChat(1)
if(chatClk(Me)){LastSaid=Me:lastSaid():lower():explode(" ")}
    if (lastSaid():sub(0,1)==ChatKey|lastSaid():sub(0,1)=="."){
        hideChat(1)
        if(chatClk(Me)&Me:lastSaid():sub(0,1)==ChatKey){Said=Me:lastSaid(),Chat[3,vector]=teamColor(Me:team())}
    
        if(chatClk(Me)&LastSaid:string(1)==".ch")
            {Chat=gTable(Me:lastSaid():sub(2),1),printColor(vec(255,150,0),"Channel Swiched to: "+Me:lastSaid():sub(5))}
        
        if(chatClk(Me)&LastSaid:string(1)==".col")
            {if(LastSaid:string(2)=="random"){TextCollor=vec(round(random(0,255)),round(random(0,255)),round(random(0,255)))}
            else{TextCollor=vec(LastSaid:number(2),LastSaid:number(3),LastSaid:number(4))}
            printColor(TextCollor,"This is your selected text color "+TextCollor:toString()+".")}

    }
Me=owner()

if(changed(Said)){
    Chat[1,string]=Said
    Chat[2,string]=Me:name()
    Chat[4,vector]=TextCollor
}

if(changed(Chat[1,string])&Chat[1,string]!=""){
    printColor(Chat[3,vector],"*"+Chat[2,string],vec(255,255,255),": ",Chat[4,vector],Chat[1,string]:sub(2))   
}
