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

add addons,mount, all

Solution
Lua:
function onLogin(player)
    local outfitsToUpgrade = {
        136, 137, 138, 139, 140, 141, 142, 147, 148, 149, 150, 155, 156, 157, 158, 252, 269, 270, 279, 288, 324, 329,
        336, 366, 431, 433, 464, 466, 471, 513, 514, 542, 575, 578, 618, 620, 632, 635, 636, 664, 666, 683, 694, 696,
        698, 724, 732, 745, 749, 759, 845, 852, 874, 885, 900, 909, 929, 956, 958, 963, 965, 967, 969, 971, 973, 975,
        128, 129, 130, 131, 132, 133, 134, 143, 144, 145, 146, 151, 152, 153, 154, 251, 268, 273, 278, 289, 325, 328,
        335, 367, 430, 432, 463, 465, 472, 512, 516, 541, 574, 577, 610, 619, 633, 634, 637, 665, 667, 684, 695, 699,
        725, 733, 746, 750, 760, 846, 853, 873, 884, 899, 908, 931, 955, 957, 962, 964, 966, 968...
ehhh
[C]: in function 'getUnownedOutfits'
data/creaturescripts/scripts/others/login.lua:163: in function <data/creaturescripts/scripts/others/login.lua:26>
 
yes,
Merged :
Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/others/login.lua:eek:nLogin
data/lib/core/player.lua:314: attempt to index local 'file' (a nil value)
stack traceback:
[C]: in function '__index'
data/lib/core/player.lua:314: in function 'getUnownedOutfits'
data/creaturescripts/scripts/others/login.lua:163: in function <data/creaturescripts/scripts/others/login.lua:26>
sorry double post
 
Last edited by a moderator:
Not sure you might have added it wrong just try another one without custom function.
Add this inside login.lua for mounts and change the 74 to your max mounts number.
Lua:
for k = 1, 74 do
        player:addMount(k)
Then create different script like this one for addons.
 
Either I'm stupid or I don't know, did you help me put it in?
login.lua
C++:
function Player.sendTibiaTime(self, hours, minutes)

    local msg = NetworkMessage()

    msg:addByte(0xEF)

    msg:addByte(hours)

    msg:addByte(minutes)

    msg:sendToPlayer(self)

    msg:delete()

    return true

end



local function onMovementRemoveProtection(cid, oldPosition, time)

    local player = Player(cid)

    if not player then

        return true

    end



    local playerPosition = player:getPosition()

    if (playerPosition.x ~= oldPosition.x or playerPosition.y ~= oldPosition.y or playerPosition.z ~= oldPosition.z) or player:getTarget() then

        player:setStorageValue(Storage.combatProtectionStorage, 0)

        return true

    end



    addEvent(onMovementRemoveProtection, 1000, cid, oldPosition, time - 1)

end



function onLogin(player)

    local loginStr = 'Welcome to ' .. configManager.getString(configKeys.SERVER_NAME) .. '!'

    if player:getLastLoginSaved() <= 0 then

        loginStr = loginStr .. ' Please choose your outfit.'

        player:sendOutfitWindow()

        player:setBankBalance(0)

    else

        if loginStr ~= "" then

            player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)

        end



        loginStr = string.format('Your last visit was on %s.', os.date('%a %b %d %X %Y', player:getLastLoginSaved()))

    end



    player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)



    local playerId = player:getId()



    DailyReward.init(playerId)



    player:loadSpecialStorage()



    --[[-- Maintenance mode

    if (player:getGroup():getId() < 2) then

        return false

    else



    end--]]



    if (player:getGroup():getId() >= 4) then

        player:setGhostMode(true)

    end



    -- Stamina

    nextUseStaminaTime[playerId] = 1



    -- EXP Stamina

    nextUseXpStamina[playerId] = 1



    -- New Prey

    nextPreyTime[playerId] = {

        [CONST_PREY_SLOT_FIRST] = 1,

        [CONST_PREY_SLOT_SECOND] = 1,

        [CONST_PREY_SLOT_THIRD] = 1

    }



    if (player:getAccountType() == ACCOUNT_TYPE_TUTOR) then

        local msg = [[:: Tutor Rules

            1 *> 3 Warnings you lose the job.

            2 *> Without parallel conversations with players in Help, if the player starts offending, you simply mute it.

            3 *> Be educated with the players in Help and especially in the Private, try to help as much as possible.

            4 *> Always be on time, if you do not have a justification you will be removed from the staff.

            5 *> Help is only allowed to ask questions related to tibia.

            6 *> It is not allowed to divulge time up or to help in quest.

            7 *> You are not allowed to sell items in the Help.

            8 *> If the player encounters a bug, ask to go to the website to send a ticket and explain in detail.

            9 *> Always keep the Tutors Chat open. (required).

            10 *> You have finished your schedule, you have no tutor online, you communicate with some CM in-game or ts and stay in the help until someone logs in, if you can.

            11 *> Always keep a good Portuguese in the Help, we want tutors who support, not that they speak a satanic ritual.

            12 *> If you see a tutor doing something that violates the rules, take a print and send it to your superiors. "

            - Commands -

            Mute Player: / mute nick, 90. (90 seconds)

            Unmute Player: / unmute nick.

            - Commands -]]

        player:popupFYI(msg)

    end



     -- OPEN CHANNELS

    if table.contains({"Rookgaard", "Dawnport"}, player:getTown():getName())then

        player:openChannel(3) -- world chat

        player:openChannel(6) -- advertsing rook main

    else

        player:openChannel(3) -- world chat

        player:openChannel(5) -- advertsing main

    end



    -- Rewards

    local rewards = #player:getRewardList()

    if(rewards > 0) then

        player:sendTextMessage(MESSAGE_INFO_DESCR, string.format("You have %d %s in your reward chest.", rewards, rewards > 1 and "rewards" or "reward"))

    end



    -- Update player id

    local stats = player:inBossFight()

    if stats then

        stats.playerId = player:getId()

    end



     if player:getStorageValue(Storage.combatProtectionStorage) < 1 then

        player:setStorageValue(Storage.combatProtectionStorage, 1)

        onMovementRemoveProtection(playerId, player:getPosition(), 10)

    end



    -- Set Client XP Gain Rate

    if Game.getStorageValue(GlobalStorage.XpDisplayMode) > 0 then

        displayRate = Game.getExperienceStage(player:getLevel())

        else

        displayRate = 1

    end

    local staminaMinutes = player:getStamina()

    local storeBoost = player:getExpBoostStamina()

    player:setStoreXpBoost(storeBoost > 0 and 50 or 0)

    if staminaMinutes > 2400 and player:isPremium() and storeBoost > 0 then

        player:setBaseXpGain(displayRate*2*100) -- Premium + Stamina boost + Store boost

        player:setStaminaXpBoost(150)

    elseif staminaMinutes > 2400 and player:isPremium() and storeBoost <= 0 then

        player:setBaseXpGain(displayRate*1.5*100) -- Premium + Stamina boost

        player:setStaminaXpBoost(150)

    elseif staminaMinutes <= 2400 and staminaMinutes > 840 and player:isPremium() and storeBoost > 0 then

        player:setBaseXpGain(displayRate*1.5*100) -- Premium + Store boost

        player:setStaminaXpBoost(100)

    elseif staminaMinutes > 840 and storeBoost > 0 then

        player:setBaseXpGain(displayRate*1.5*100) -- FACC + Store boost

        player:setStaminaXpBoost(100)

    elseif staminaMinutes <= 840 and storeBoost > 0 then

        player:setBaseXpGain(displayRate*1*100) -- ALL players low stamina + Store boost

        player:setStaminaXpBoost(50)

    elseif staminaMinutes <= 840 then

        player:setBaseXpGain(displayRate*0.5*100) -- ALL players low stamina

        player:setStaminaXpBoost(50)

    end



    if player:getClient().version > 1110 then

        local worldTime = getWorldTime()

        local hours = math.floor(worldTime / 60)

        local minutes = worldTime % 60

        player:sendTibiaTime(hours, minutes)

    end

  

    if player:getStorageValue(Storage.isTraining) == 1 then -- redefinir storage de exercise weapon

        player:setStorageValue(Storage.isTraining,0)

    end

    return true

end
 
Last edited:
This should work for mounts add it instead of your login.lua
Lua:
function Player.sendTibiaTime(self, hours, minutes)

    local msg = NetworkMessage()

    msg:addByte(0xEF)

    msg:addByte(hours)

    msg:addByte(minutes)

    msg:sendToPlayer(self)

    msg:delete()

    return true

end



local function onMovementRemoveProtection(cid, oldPosition, time)

    local player = Player(cid)

    if not player then

        return true

    end



    local playerPosition = player:getPosition()

    if (playerPosition.x ~= oldPosition.x or playerPosition.y ~= oldPosition.y or playerPosition.z ~= oldPosition.z) or player:getTarget() then

        player:setStorageValue(Storage.combatProtectionStorage, 0)

        return true

    end



    addEvent(onMovementRemoveProtection, 1000, cid, oldPosition, time - 1)

end



function onLogin(player)

    local loginStr = 'Welcome to ' .. configManager.getString(configKeys.SERVER_NAME) .. '!'

    if player:getLastLoginSaved() <= 0 then

        loginStr = loginStr .. ' Please choose your outfit.'

        player:sendOutfitWindow()

        player:setBankBalance(0)

    else

        if loginStr ~= "" then
        for k = 1, 74 do
        player:addMount(k)
            player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)

        end



        loginStr = string.format('Your last visit was on %s.', os.date('%a %b %d %X %Y', player:getLastLoginSaved()))

    end



    player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)



    local playerId = player:getId()



    DailyReward.init(playerId)



    player:loadSpecialStorage()



    --[[-- Maintenance mode

    if (player:getGroup():getId() < 2) then

        return false

    else



    end--]]



    if (player:getGroup():getId() >= 4) then

        player:setGhostMode(true)

    end



    -- Stamina

    nextUseStaminaTime[playerId] = 1



    -- EXP Stamina

    nextUseXpStamina[playerId] = 1



    -- New Prey

    nextPreyTime[playerId] = {

        [CONST_PREY_SLOT_FIRST] = 1,

        [CONST_PREY_SLOT_SECOND] = 1,

        [CONST_PREY_SLOT_THIRD] = 1

    }



    if (player:getAccountType() == ACCOUNT_TYPE_TUTOR) then

        local msg = [[:: Tutor Rules

            1 *> 3 Warnings you lose the job.

            2 *> Without parallel conversations with players in Help, if the player starts offending, you simply mute it.

            3 *> Be educated with the players in Help and especially in the Private, try to help as much as possible.

            4 *> Always be on time, if you do not have a justification you will be removed from the staff.

            5 *> Help is only allowed to ask questions related to tibia.

            6 *> It is not allowed to divulge time up or to help in quest.

            7 *> You are not allowed to sell items in the Help.

            8 *> If the player encounters a bug, ask to go to the website to send a ticket and explain in detail.

            9 *> Always keep the Tutors Chat open. (required).

            10 *> You have finished your schedule, you have no tutor online, you communicate with some CM in-game or ts and stay in the help until someone logs in, if you can.

            11 *> Always keep a good Portuguese in the Help, we want tutors who support, not that they speak a satanic ritual.

            12 *> If you see a tutor doing something that violates the rules, take a print and send it to your superiors. "

            - Commands -

            Mute Player: / mute nick, 90. (90 seconds)

            Unmute Player: / unmute nick.

            - Commands -]]

        player:popupFYI(msg)

    end



     -- OPEN CHANNELS

    if table.contains({"Rookgaard", "Dawnport"}, player:getTown():getName())then

        player:openChannel(3) -- world chat

        player:openChannel(6) -- advertsing rook main

    else

        player:openChannel(3) -- world chat

        player:openChannel(5) -- advertsing main

    end



    -- Rewards

    local rewards = #player:getRewardList()

    if(rewards > 0) then

        player:sendTextMessage(MESSAGE_INFO_DESCR, string.format("You have %d %s in your reward chest.", rewards, rewards > 1 and "rewards" or "reward"))

    end



    -- Update player id

    local stats = player:inBossFight()

    if stats then

        stats.playerId = player:getId()

    end



     if player:getStorageValue(Storage.combatProtectionStorage) < 1 then

        player:setStorageValue(Storage.combatProtectionStorage, 1)

        onMovementRemoveProtection(playerId, player:getPosition(), 10)

    end



    -- Set Client XP Gain Rate

    if Game.getStorageValue(GlobalStorage.XpDisplayMode) > 0 then

        displayRate = Game.getExperienceStage(player:getLevel())

        else

        displayRate = 1

    end

    local staminaMinutes = player:getStamina()

    local storeBoost = player:getExpBoostStamina()

    player:setStoreXpBoost(storeBoost > 0 and 50 or 0)

    if staminaMinutes > 2400 and player:isPremium() and storeBoost > 0 then

        player:setBaseXpGain(displayRate*2*100) -- Premium + Stamina boost + Store boost

        player:setStaminaXpBoost(150)

    elseif staminaMinutes > 2400 and player:isPremium() and storeBoost <= 0 then

        player:setBaseXpGain(displayRate*1.5*100) -- Premium + Stamina boost

        player:setStaminaXpBoost(150)

    elseif staminaMinutes <= 2400 and staminaMinutes > 840 and player:isPremium() and storeBoost > 0 then

        player:setBaseXpGain(displayRate*1.5*100) -- Premium + Store boost

        player:setStaminaXpBoost(100)

    elseif staminaMinutes > 840 and storeBoost > 0 then

        player:setBaseXpGain(displayRate*1.5*100) -- FACC + Store boost

        player:setStaminaXpBoost(100)

    elseif staminaMinutes <= 840 and storeBoost > 0 then

        player:setBaseXpGain(displayRate*1*100) -- ALL players low stamina + Store boost

        player:setStaminaXpBoost(50)

    elseif staminaMinutes <= 840 then

        player:setBaseXpGain(displayRate*0.5*100) -- ALL players low stamina

        player:setStaminaXpBoost(50)

    end



    if player:getClient().version > 1110 then

        local worldTime = getWorldTime()

        local hours = math.floor(worldTime / 60)

        local minutes = worldTime % 60

        player:sendTibiaTime(hours, minutes)

    end

 

    if player:getStorageValue(Storage.isTraining) == 1 then -- redefinir storage de exercise weapon

        player:setStorageValue(Storage.isTraining,0)

    end

    return true
end
end
And for the addons one in your data\creaturescripts\scripts create a script name it
allplayersaddon.lua
Then add this inside it
Lua:
function onLogin(player)
    local outfitsToUpgrade = {
        136, 137, 138, 139, 140, 141, 142, 147, 148, 149, 150, 155, 156, 157, 158, 252, 269, 270, 279, 288, 324, 329,
        336, 366, 431, 433, 464, 466, 471, 513, 514, 542, 575, 578, 618, 620, 632, 635, 636, 664, 666, 683, 694, 696,
        698, 724, 732, 745, 749, 759, 845, 852, 874, 885, 900, 909, 929, 956, 958, 963, 965, 967, 969, 971, 973, 975,
        128, 129, 130, 131, 132, 133, 134, 143, 144, 145, 146, 151, 152, 153, 154, 251, 268, 273, 278, 289, 325, 328,
        335, 367, 430, 432, 463, 465, 472, 512, 516, 541, 574, 577, 610, 619, 633, 634, 637, 665, 667, 684, 695, 699,
        725, 733, 746, 750, 760, 846, 853, 873, 884, 899, 908, 931, 955, 957, 962, 964, 966, 968, 970, 972, 974
    }


    if player:getStorageValue(94549) < 1 then
        for i = 1, #outfitsToUpgrade do
            player:addOutfitAddon(outfitsToUpgrade[i], 2)
        end
        player:setStorageValue(94549, 1)
    end

    return true
end
And in data\creaturescripts\creaturescripts.xml add
XML:
<event type="login" name="allplayersaddon" script="allplayersaddon.lua" />
 
Last edited:
Lua:
function onLogin(player)
    local outfitsToUpgrade = {
        136, 137, 138, 139, 140, 141, 142, 147, 148, 149, 150, 155, 156, 157, 158, 252, 269, 270, 279, 288, 324, 329,
        336, 366, 431, 433, 464, 466, 471, 513, 514, 542, 575, 578, 618, 620, 632, 635, 636, 664, 666, 683, 694, 696,
        698, 724, 732, 745, 749, 759, 845, 852, 874, 885, 900, 909, 929, 956, 958, 963, 965, 967, 969, 971, 973, 975,
        128, 129, 130, 131, 132, 133, 134, 143, 144, 145, 146, 151, 152, 153, 154, 251, 268, 273, 278, 289, 325, 328,
        335, 367, 430, 432, 463, 465, 472, 512, 516, 541, 574, 577, 610, 619, 633, 634, 637, 665, 667, 684, 695, 699,
        725, 733, 746, 750, 760, 846, 853, 873, 884, 899, 908, 931, 955, 957, 962, 964, 966, 968, 970, 972, 974
    }


    if player:getStorageValue(94549) < 1 then
        for i = 1, #outfitsToUpgrade do
            player:addOutfitAddon(outfitsToUpgrade[i], 2)
            player:addOutfitAddon(outfitsToUpgrade[i], 1)
        end
        player:setStorageValue(94549, 1)
    end

    return true
end
 
Solution
Try creating new character because this one has the storage added before.
 
You should be marking the best answer as the one that ACTUALLY helped you, not the last idea that made the original script/idea work.
 
Back
Top