hi
thank you for this script.
but the player name can't click in world channel just like other channels. can you make the player name clickable?
I got the method.
just change the playername like this:
|Hplayerlayername|h[playername]|h
hi
thank you for this script.
but the player name can't click in world channel just like other channels. can you make the player name clickable?
local ChatPrefix = "#w";
local WorldChannelName = "World Channel";
local CooldownTimer = 5; -- Cooldown in seconds. Set to 0 for no CD obviously.
local Class = { -- Class colors :) Prettier and easier than the elseif crap :) THESE ARE HEX COLORS!
[1] = "C79C6E", -- Warrior
[2] = "F58CBA", -- Paladin
[3] = "ABD473", -- Hunter
[4] = "FFF569", -- Rogue
[5] = "FFFFFF", -- Priest
[6] = "C41F3B", -- Death Knight
[7] = "0070DE", -- Shaman
[8] = "69CCF0", -- Mage
[9] = "9482C9", -- Warlock
[11] = "FF7d0A" -- Druid
};
local Rank = {
[0] = "7DFF00", -- Player
[1] = "E700B1", -- Moderator
[2] = "E7A200", -- Game Master
[3] = "E7A200", -- Admin
[4] = "E7A200" -- Console
};
-- Do not edit below unless you know what you're doing :)
if (ChatPrefix:sub(-1) ~= " ") then
ChatPrefix = ChatPrefix.." ";
end
local RCD = {};
function ChatSystem(event, player, msg, _, lang)
if (RCD[player:GetGUIDLow()] == nil) then
RCD[player:GetGUIDLow()] = 0;
end
if (msg:sub(1, ChatPrefix:len()) == ChatPrefix) then
local r = RCD[player:GetGUIDLow()] - os.clock();
if (0 < r) then
local s = string.format("|cFFFF0000You must wait %i second(s) before sending another chat message!|r", math.floor(r));
player:SendAreaTriggerMessage(s);
else
RCD[player:GetGUIDLow()] = os.clock() + CooldownTimer;
local t = table.concat({"[", WorldChannelName, "] [" , "|Hplayer:", player:GetName(), "|h", player:GetName(), "|h]: ", msg:sub(ChatPrefix:len()+1), ""});
SendWorldMessage(t);
end
return false;
end
end
RegisterPlayerEvent(18, ChatSystem);
RegisterPlayerEvent(4, function(_, player) RCD[player:GetGUIDLow()] = 0; end);
PLAYER_EVENT_ON_CHAT = 18, // (event, player, msg, Type, lang) - Can return false
PLAYER_EVENT_ON_GUILD_CHAT = 21, // (event, player, msg, Type, lang, guild)
PLAYER_EVENT_ON_CHANNEL_CHAT = 22, // (event, player, msg, Type, lang, channel)
to only do something when it is in /world channel.if(channel==0)then
Thanks for your personal version
I am getting the error
worldchat.lua:28: attempy to index global 'ACCT' <a nil value>