slp13at420
Mad Scientist
World Chat
<MOD><Release>
a simple World Chat system with adjustable colors and channel name.
this is a mutation of [MENTION=7]Foereaper[/MENTION]'s chat script.
I modified this so you wont need to type '#chat' every time you type a message.
to use this just change to `/say` channel then type '#chat on' to turn your access on then type away .
Once your done just type '#chat off' to turn your access off.
Name colors are team based. Ally blue, Horde red.
Contains a duration timer to help manage rapid spamming.
this should ignore add-on messages. - unteseted -
now supports the `.reload Eluna` command.
Code:
[COLOR="#808080"]
-- by slp13at420 of EmuDevs.com
-- a mutation of FoeReaper's world chat with basic bells an whistles.
-- simple world chat WITHOUT the '#chat' command...WTF you say?
-- just change to /say channel
-- turn it on
-- and chat away.
-- names are clickable for whispers and sub menu.
local WorldChat = {};
local channel_name = "World Chat";
local on = "#chat on";
local off = "#chat off";
local duration = 5; -- in seconds.
local Colors = { -- colors for names and misc
[0] = "|cff3399FF", -- blue for alliance name
[1] = "|cffFF0000", -- red for horde name
[3] = "|cff000000", -- black for [channel name]
[4] = "|cff00cc00", -- green for "message"
[5] = "|cff3399ff", -- good responce
[6] = "|cffFF0000", -- bad responce
};
local function ChatSystem(event, player, msg, type, lang, channel)
local acct_id = player:GetAccountId();
if not(WorldChat[acct_id])then
WorldChat[acct_id] = {
chat = 0,
time = GetGameTime()-duration,
};
end
if(lang ~= -1)then
if(msg ~= "")then
if(msg ~= "Away")then
if(msg == off)then
WorldChat[acct_id].chat = 0;
player:SendBroadcastMessage(Colors[5].."World chat off.|r")
return false;
end
if(msg == on)then
WorldChat[acct_id].chat = 1;
player:SendBroadcastMessage(Colors[5].."World chat on.|r")
return false;
end
if(WorldChat[acct_id].chat == 1)then -- 0 = world chat off :: 1 = world chat on
local time = GetGameTime();
if(time-WorldChat[acct_id].time >= duration)then
local t = table.concat{"[", Colors[3], channel_name, "|r]", "[", Colors[player:GetTeam()],"|Hplayer:", player:GetName(), "|h", player:GetName(), "|h", "|r]:", Colors[4], msg, "|r"};
SendWorldMessage(t);
WorldChat[acct_id].time = time;
else
player:SendBroadcastMessage(Colors[6].."World chat spam timer detected.|r")
end
return false;
end
end
end
end
end
RegisterPlayerEvent(18, ChatSystem)
print("Grumbo'z World Chat loaded.")
[/COLOR]
Alliance:
Horde:
Last edited: