Welcome to AC Web.
Results 1 to 5 of 5
  1. #1

    Eluna script question


    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    Hey guys my question is about a a world chat script if i type Prefix #w the world chat works but on the script if i change the Prefix = "#w"; to Prefix = ".world"; or something like that it aint working? can some one explain me why? the script in question is this

    ---
    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({"|cff7DFF00[", WorldChannelName, "] [|r|cff", Rank[player:GetGMRank()] or Rank[0], "|Hplayer:", player:GetName(), "|h", player:GetName(), "|h|r|cff7DFF00]: |r|cff", Class[player:GetClass()], msg:sub(ChatPrefix:len()+1), "|r"});
    SendWorldMessage(t);
    end
    return false;
    end
    end

    RegisterPlayerEvent(18, ChatSystem);
    RegisterPlayerEvent(4, function(_, player) RCD[player:GetGUIDLow()] = 0; end);

  2. #2


    Join Date
    Jan 2018
    Location
    shadowmelt.com
    Posts
    145
    Eluna can not use .world, if you want that you must add a customized c++ script, just a simple good search there are many out there.

    Regarding lua you can only use the following symbols as a command starter ! and #

    Enjoy

  3. #3


    Join Date
    Dec 2015
    Location
    Developing the world
    Posts
    1,226
    Quote Originally Posted by Casian View Post
    Eluna can not use .world, if you want that you must add a customized c++ script, just a simple good search there are many out there.

    Regarding lua you can only use the following symbols as a command starter ! and #

    Enjoy
    That's quite wrong. Eluna CAN use '.', as a prefix.

  4. #4
    Quote Originally Posted by titkata_bg View Post
    That's quite wrong. Eluna CAN use '.', as a prefix.
    Then how can i do it can you tell me?

  5. #5
    weird like that

    Join Date
    Feb 2010
    Location
    http://rochet2.github.io/
    Posts
    5,289

    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    To be able to use a dot as prefix you must use the command event.
    PLAYER_EVENT_ON_COMMAND = 42, // (event, player, command)
    http://elunaluaengine.github.io/Glob...ayerEvent.html

    You also cannot override any existing commands with this, so if any real command is matched then that will run instead of your command.
    You can return false in the registered function to cancel the error message about command not being found.
    The command parameter in this event is the command you do (for example .hello) without the dot at the beginning.
    The player parameter is nil if the command was done from server console.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •