• 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!

[Tutorial] First login tutorial

Fallen

Freelancer
Senator
Joined
Aug 21, 2009
Messages
3,712
Reaction score
250
Location
Egypt
Credits to Nahruto!
LUA:
local config = 
    {
        tilepos1 = {x=200, y=200, z=7},
        tilepos2 = {x=200, y=200, z=7},
        tilepos3 = {x=200, y=200, z=7},
        tilepos4 = {x=200, y=200, z=7},
        playerlevel = 20,
        effects = {0, 10, 39},
        str1 = "Welcome to " .. getConfigValue("Server Name") .. ", Please go down the stairs to complete your tour.",
        str2 = "To start your tour please enter the teleport.",
        str3 = "All right now Click on the sewer gate and kill slimes, after You get level 20 go back to the depot and you will get teleported to get your new promotion.",
        str4 = "Talk to [Npc Name] to get your promotion!",
        str5 = "Congratulations! You\'ve completed the tutorial sucessfully!"
    }
    
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local myTable = 
    {
        [10031] = {stor = 9531, tp = true, pos = config.tilepos2, str = config.str1, lvl = 0},
        [10032] = {stor = 9532, tp = true, pos = config.tilepos3, str = config.str2, lvl = 0},
        [10033] = {stor = 9533, tp = false, pos = nil, str = config.str3, lvl = 0},
        [10034] = {stor = 9534, tp = false, pos = config.tilepos4, str = config.str4, lvl = config.playerlevel}
    
    }
    if isPlayer(cid) then
        local action = myTable[item.actionid]
        if action then
            if (getPlayerStorageValue(cid, action.stor) == -1) then
                if (getPlayerLevel(cid) >= action.playerlevel) then
                    doPlayerPopupFYI(cid, action.str)
                    setPlayerStorageValue(cid, action.stor, 1)
                    if action.pos then
                        doSendMagicEffect(action.pos, 55)
                        if action.tp then
                            doTeleportThing(cid, action.pos)
                        end
                    end
                    for i = 1, #config.effect do
                        doSendMagicEffect(getPlayerPosition(cid), effect[i])
                    end
                else
                    doPlayerSendCancel(cid, "You\'ve not reached level " .. action.playerlevel .. " or higher yet.")
                end
            else
                doPlayerSendCancel(cid, "You\'ve completed that once.")
            end
        end
    end
    return true
end
:peace:
 
Last edited:
Back
Top