PHP Code:
//#CLIENTSIDE
function onPlayerChats()
{
if (player.chat == "unstick me")
{
return false;
}
temp.filters = {
{ {"no", "nah", "nay"}, {"ar", "yar matey", "aye laddy"}},
{ {"hello", "hi", "hey", "hiya"}, {"'ey matey", "avast"}},
{ {"***"}, {"scallywag", "scallywag"}},
{ {"****"}, {"arrrrrrrrg", "fuk", "arrg", "arrrrrrrrrrrrrrrrrrrg"}},
{ {"nig", "******", "ngr", "nigro", "negro"}, {"blackskinned folk", "blacker folk", "cursed people"}},
{ {"****"}, {"scurvy", "davey jones waste"}},
{ {"****", "****", "dik"}, {"mast", "treasure chest"}},
{ {"douchebag"}, {"waterdog", "water dog"}},
{ {"daz"}, {"black beard", "blackbeard"}},
{ {"staf", "staff"}, {"crew", "maties"}},
{ {"vulcan"}, {"deckboy", "deck boy"}},
{ {"yes", "yeah", "yea"}, {"yar", "yaaar"}},
{ {"people", "person", "guy", "man"}, {"folk", "mate"}},
{ {"there"}, {"ahoy"}},
{ {"money", "cash"}, {"dubloon", "dubloons"}}
};
temp.chat = player.chat.tokenize();
for (temp.i: temp.chat)
{
for (temp.f: temp.filters)
{
for (temp.g: temp.f[0])
{
temp.newChat = false;
if (temp.g == temp.i.lower())
{
temp.newChat = randomstring(temp.f[1]);
}
else
if (temp.i.lower().starts(temp.g))
{
temp.newChat = randomstring(temp.f[1]) @ temp.i.substring(temp.g.length());
}
else
if (temp.i.lower().ends(temp.g))
{
temp.newChat = temp.i.substring(0, temp.g.length()) @ randomstring(temp.f[1]);
}
if (temp.newChat != false)
{
temp.chat.replace(temp.c, temp.newChat);
}
}
}
temp.c++;
}
temp.newChat = "";
for (temp.c: temp.chat)
{
temp.newChat @= temp.c @ " ";
}
player.chat = temp.newChat;
}