Hello, this is my first post here, I'm just going to ask how I sort this out.
I'm trying to make a translator script from normal chat to chavspeak but currently it does not work. It should turn hi into sfe, hey into wagwan, hello into yo and helo into oi. It does not do that, except it does turn helo into oi.
Can someone help me with it please?
code:
function OnEvent_Initialize(MessengerStart)
{
}
function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
var Greet1 = new Array();
Greet1[0] = "hi";
Greet1[1] = "hey";
Greet1[2] = "hello";
Greet1[3] = "helo";
var Greet2 = new Array();
Greet2[0] = "sfe";
Greet2[1] = "wagwan";
Greet2[2] = "yo"
Greet2[3] = "oi"
var x=0;
for (x=0; x<4; x++)
{
ChatWnd.EditText = Message.replace(Greet1[x], Greet2[x]);
}
}
function OnEvent_Uninitialize(MessengerExit)
{
}