• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

need script

Sry @up, I was writing it while you replied.
in data\creaturescripts\scripts add a script name it GMLogin.lua then add this code inside it
Lua:
function onLogin(player)
if player:getAccountType() < ACCOUNT_TYPE_GAMEMASTER then
Game.broadcastMessage ("' .. player:getName() .. ' Has now logged in", MESSAGE_STATUS_WARNING)
end
end
and in data\creaturescripts\creaturescripts.xml add this
XML:
<event type="login" name="GMLogin" script="GMLogin.lua" />
and then in data\creaturescripts\scripts\login.lua add this (Not sure if its needed)
Lua:
player:registerEvent("GMLogin")
 
XML:
    <event type="login" name="InnerCircleBadBoys" script="popo.lua" />
Darude Sandstorm


Lua:
function onLogin(player)
    if player:getAccountType() < ACCOUNT_TYPE_GAMEMASTER then
        return true
    end
    -- GM message
    local message = "The constabulary has arrived!"
    -- God message
    if player:getAccountType() == ACCOUNT_TYPE_GOD then
        message = "Judgment day is here!"
    end
    -- Color choices
    -- MESSAGE_STATUS_WARNING = 18, /*Red message in game window and in the console*/
    -- MESSAGE_EVENT_ADVANCE = 19,  /*White message in game window and in the console*/
    -- MESSAGE_INFO_DESCR = 22,     /*Green message in game window and in the console*/

    Game.broadcastMessage(message, MESSAGE_STATUS_WARNING) 
    print("> Broadcasted message: \"" .. message .. "\".")

    return true
end
 
Yes!

use code like this to concatenate strings returned by functions:
Lua:
-- in the middle
local string1 = "string text" .. player:getName() .. "more string text"
-- at the end, no dots, only use dots as a connector
local string2 = "string text" .. player:getName()
-- at the beginning
local string3 = player:getName() .. "string text"

-- example
local message = "The Gamemaster " .. player:getName() .. " has logged in! Cavebotters beware!"

make sure to account for spaces cuz if you do something like
local message = "Gamemaster" .. player:getName()
you could end up with "GamemasterFelipe" instead of "Gamemaster Felipe" like you probably wanted
Post automatically merged:

It that gave you everything you needed, please mark best answer
🧐
 
Last edited:
Back
Top