• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

World Chat Script

dsy86

Enthusiast
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:

|Hplayer:playername|h[playername]|h
 

slp13at420

Mad Scientist
the colors are easy to remove. just gotta watch what you do remove.

Code:
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);
bare minimum removed to remove the color.
 
Last edited:

Barebones

BETA Tester
I sorta got it. Added in those icons. ;D

wih5XLS.jpg
 

creativextent

Enthusiast
This is pretty cool. i have this and a hard coded mod.
Now... is there a way to make it like a default channel such as /2 Trade or /1 General ?
 

slp13at420

Mad Scientist
there is .. I have my world chat triggered to /world channel . and as you see guild warz is triggered by /guild channel.

this event 18 is for /say channel
PLAYER_EVENT_ON_CHAT = 18, // (event, player, msg, Type, lang) - Can return false

this event 21 is for guild chat channel
PLAYER_EVENT_ON_GUILD_CHAT = 21, // (event, player, msg, Type, lang, guild)

this event 22 is for channel chats
PLAYER_EVENT_ON_CHANNEL_CHAT = 22, // (event, player, msg, Type, lang, channel)

I used event 22 to tie my world chat to channels. then used
if(channel==0)then
to only do something when it is in /world channel.

here is a link to my modified version of foereaper's world chat : http://pastebin.com/zVrCyQC0

with that I just have to /join world then start typing
 
Last edited:

slp13at420

Mad Scientist
Thanks for your personal version :)

I am getting the error

worldchat.lua:28: attempy to index global 'ACCT' <a nil value>

that's due to its trying to get info from a non-exsisting table ACCT{}. lol no prob I just threw that up there to show as an example but I updated the pastebin so it shouldn't produce that error now.
 
Top