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

Scrolls error TFS 1.3

nanduzenho

Member
Joined
Mar 21, 2021
Messages
187
Solutions
1
Reaction score
15
GitHub
nanduzenho
good afternoon, I have these scripts that are several scrolls. A while ago a member helped me with this part:

Lua:
    if player:hasAchievement("Marid Ally") or player:hasAchievement("Efreet Ally") then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, "You have already chosen whom will be your ally. You cannot change your decision.")
        return true
    end


However I am no longer able to use the other scrolls, and the decision was only for scrolls 13 (blue djinn) and 14 (green djinn), Could someone fix it for me?

Lua:
local config = {
    [13263] = 1,  --Dragon outfit scroll
    [13264] = 2,  --Demon outfit scroll
    [13265] = 3,  --Centurion outfit scroll,
    [13266] = 4,  --TBI secret service scroll
    [13267] = 5,  --CGB secret service scroll
    [13268] = 6,  --AVIN secret service scroll
    [13269] = 7,  --Link's outfit scroll
    [13270] = 8,  --Rashid scroll
    [13271] = 9,  --Explorer society scroll
    [13272] = 10, --Thieves Guild scroll
    [13273] = 11, --Jester outfits scroll
    [13274] = 12, --Postman scroll
    [13275] = 13, --Blue Djinn scroll
    [13276] = 14, --Green Djinn scroll
    [13277] = 15, --Angel outfit scroll
    [13278] = 16, --Warrior Mount outfit scroll
    [13279] = 17, --Demon Hunter Mount outfit scroll
    [13280] = 18, --Assassin Mount outfit scroll
    [13281] = 19, --Shaman Mount outfit scroll
    [13282] = 20, --Blood Warior outfit scroll
    [13283] = 21, --Desert Rider outfit scroll
    [13284] = 22, --Summoner Mount outfit scroll
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    
    local scroll = config[item.itemid]
    if not scroll then
        return true
    end
    
    -- Xikini's edit.
    if player:hasAchievement("Marid Ally") or player:hasAchievement("Efreet Ally") then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, "You have already chosen whom will be your ally. You cannot change your decision.")
        return true
    end   
    
    if scroll == 1 then
        --Dragon outfit scroll
        player:addOutfit(452, 0)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The Gods blessed you with Dragon outfit.")
    end
    
    if scroll == 2 then
        --Demon outfit scroll
        player:addOutfit(432, 0)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The Gods blessed you with Demon outfit.")
    end
    
    
    if scroll == 3 then
        --Centurion outfit
        player:addOutfit(455, 0)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The Gods blessed you with Centurion outfit.")
    end
    
    
    if scroll == 4 then
        --TBI secret service scroll       
        player:setStorageValue(Storage.secretService.TBIMission01, 3)
        player:setStorageValue(Storage.secretService.TBIMission02, 2)
        player:setStorageValue(Storage.secretService.TBIMission03, 3)
        player:setStorageValue(Storage.secretService.TBIMission04, 2)
        player:setStorageValue(Storage.secretService.TBIMission05, 3)
        player:setStorageValue(Storage.secretService.TBIMission06, 3)
        player:setStorageValue(Storage.secretService.Mission07, 2)
        player:setStorageValue(Storage.secretService.Quest, 15)
        player:addItem(7960, 1)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The Gods blessed you.. now you has a title of Top Agent.")
    end
    
    if scroll == 5 then
        --CGB secret service scroll
        player:setStorageValue(Storage.secretService.CGBMission01, 2)
        player:setStorageValue(Storage.secretService.CGBMission02, 2)
        player:setStorageValue(Storage.secretService.CGBMission03, 3)
        player:setStorageValue(Storage.secretService.CGBMission04, 2)
        player:setStorageValue(Storage.secretService.CGBMission05, 2)
        player:setStorageValue(Storage.secretService.CGBMission06, 2)
        player:setStorageValue(Storage.secretService.Mission07, 2)
        player:setStorageValue(Storage.secretService.Quest, 15)
        player:addItem(7961, 1)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The Gods blessed you.. now you has a title of Top Agent.")
    end
    
    if scroll == 6 then
        --AVIN secret service scroll
        player:setStorageValue(Storage.secretService.AVINMission01, 4)
        player:setStorageValue(Storage.secretService.AVINMission02, 2)
        player:setStorageValue(Storage.secretService.AVINMission03, 4)
        player:setStorageValue(Storage.secretService.AVINMission04, 3)
        player:setStorageValue(Storage.secretService.AVINMission05, 2)
        player:setStorageValue(Storage.secretService.AVINMission06, 3)
        player:setStorageValue(Storage.secretService.Mission07, 2)
        player:setStorageValue(Storage.secretService.Quest, 15)
        player:addItem(7962, 1)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The Gods blessed you.. now you has a title of Top Agent.")
    end
    
    
    if scroll == 7 then
        --Link's outfit scroll
        player:addOutfit(459, 0)
        player:addOutfit(460, 0)
        player:addOutfit(461, 0)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The Gods blessed you with 3 Link's outfit.")
    end
    
    if scroll == 8 then
        --Rashid scroll
        player:setStorageValue(Storage.TravellingTrader.Mission01, 2)
        player:setStorageValue(Storage.TravellingTrader.Mission02, 5)
        player:setStorageValue(Storage.TravellingTrader.Mission03, 3)
        player:setStorageValue(Storage.TravellingTrader.Mission04, 3)
        player:setStorageValue(Storage.TravellingTrader.Mission05, 3)
        player:setStorageValue(Storage.TravellingTrader.Mission06, 2)
        player:setStorageValue(Storage.TravellingTrader.Mission07, 1)
        player:addAchievement('Recognised Trader')
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The Gods blessed you.. now you has a title of Recognised Trader.")
    end
    
    if scroll == 9 then
        --Explorer society scroll
        player:setStorageValue(Storage.ExplorerSociety.bonelordsDoor, 1)
        player:setStorageValue(Storage.ExplorerSociety.edronDoor, 1)
        player:setStorageValue(Storage.ExplorerSociety.giantsmithhammer, 1)
        player:setStorageValue(Storage.ExplorerSociety.orcDoor, 1)
        player:setStorageValue(Storage.ExplorerSociety.skullofratha, 1)
        player:setStorageValue(Storage.ExplorerSociety.SpectralStone, 2)
        player:setStorageValue(Storage.ExplorerSociety.TheAstralPortals, 56)
        player:setStorageValue(Storage.ExplorerSociety.TheBonelordSecret, 32)
        player:setStorageValue(Storage.ExplorerSociety.TheButterflyHunt, 16)
        player:setStorageValue(Storage.ExplorerSociety.TheEctoplasm, 47)
        player:setStorageValue(Storage.ExplorerSociety.TheElvenPoetry, 38)
        player:setStorageValue(Storage.ExplorerSociety.TheIceDelivery, 7)
        player:setStorageValue(Storage.ExplorerSociety.TheLizardUrn, 29)
        player:setStorageValue(Storage.ExplorerSociety.TheMemoryStone, 41)
        player:setStorageValue(Storage.ExplorerSociety.ThePlantCollection, 26)
        player:setStorageValue(Storage.ExplorerSociety.TheRuneWritings, 44)
        player:setStorageValue(Storage.ExplorerSociety.TheSpectralDress, 48)
        player:setStorageValue(Storage.ExplorerSociety.TheSpectralStone, 53)
        player:setStorageValue(Storage.ExplorerSociety.urnDoor, 1)
        player:setStorageValue(Storage.ExplorerSociety.JoiningtheExplorers, 4)
        player:setStorageValue(Storage.ExplorerSociety.TheOrcPowder, 35)
        player:setStorageValue(Storage.ExplorerSociety.TheIceMusic, 62)
        player:setStorageValue(Storage.ExplorerSociety.QuestLine, 62)       
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The Gods blessed you.. now you has a the highest ranks of the Explorer Society.")
    end
    
    if scroll == 10 then
        --Thieves Guild scroll
        player:setStorageValue(Storage.thievesGuild.Door, 1)
        player:setStorageValue(Storage.thievesGuild.Mission01, 2)
        player:setStorageValue(Storage.thievesGuild.Mission02, 3)
        player:setStorageValue(Storage.thievesGuild.Mission03, 3)
        player:setStorageValue(Storage.thievesGuild.Mission04, 8)
        player:setStorageValue(Storage.thievesGuild.Mission05, 2)
        player:setStorageValue(Storage.thievesGuild.Mission06, 4)
        player:setStorageValue(Storage.thievesGuild.Mission07, 2)
        player:setStorageValue(Storage.thievesGuild.Mission08, 3)       
        player:setStorageValue(Storage.thievesGuild.Quest, 9)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The Gods blessed you.. now you part of the Thieves Guild and have the hability to trade with Black Bert.")
    end
    
    
    if scroll == 11 then
        --Jester outfits scroll
        player:setStorageValue(Storage.WhatAFoolishQuest.Mission1, 2)
        player:setStorageValue(Storage.WhatAFoolishQuest.Mission2, 2)
        player:setStorageValue(Storage.WhatAFoolishQuest.Mission3, 2)
        player:setStorageValue(Storage.WhatAFoolishQuest.Mission4, 3)
        player:setStorageValue(Storage.WhatAFoolishQuest.Mission5, 3)
        player:setStorageValue(Storage.WhatAFoolishQuest.Mission6, 5)
        player:setStorageValue(Storage.WhatAFoolishQuest.Mission7, 2)
        player:setStorageValue(Storage.WhatAFoolishQuest.Mission8, 5)
        player:setStorageValue(Storage.WhatAFoolishQuest.Mission9, 5)
        player:setStorageValue(Storage.WhatAFoolishQuest.Mission10, 2)
        player:setStorageValue(Storage.WhatAFoolishQuest.Mission11, 4)
        player:setStorageValue(Storage.WhatAFoolishQuest.JesterOutfit, 4)
        player:setStorageValue(Storage.WhatAFoolishQuest.LostDisguise, 1)
        player:setStorageValue(Storage.WhatAFoolishQuest.QueenEloiseCatDoor, 1)
        player:setStorageValue(Storage.WhatAFoolishQuest.TriangleTowerDoor, 1)
        player:setStorageValue(Storage.WhatAFoolishQuest.Questline, 36)       
        player:addAchievement('Perfect Fool')
        player:addItem(7957)
        player:addItem(7958,1)
        player:addOutfit(270)
        player:addOutfit(273)
        player:addOutfitAddon(270, 3)
        player:addOutfitAddon(273, 3)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The Gods blessed you.. now you become a complete fool.")
    end
    
    if scroll == 12 then
        --Postman scroll
        player:setStorageValue(Storage.postman.Mission01, 6)
        player:setStorageValue(Storage.postman.Mission02, 3)
        player:setStorageValue(Storage.postman.Mission03, 3)
        player:setStorageValue(Storage.postman.Mission04, 2)
        player:setStorageValue(Storage.postman.Mission05, 4)
        player:setStorageValue(Storage.postman.Mission06, 13)
        player:setStorageValue(Storage.postman.Mission07, 8)
        player:setStorageValue(Storage.postman.Mission08, 3)
        player:setStorageValue(Storage.postman.Mission09, 4)
        player:setStorageValue(Storage.postman.Mission10, 3)
        player:setStorageValue(Storage.postman.Rank, 5)
        player:setStorageValue(Storage.postman.Door, 1)
        player:addItem(2665, 1)
        player:addItem(2078, 1)
        player:addAchievement('Archpostman')       
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The Gods blessed you.. now you become archpostman.")
    end
    
    if scroll == 13 then
        --Blue Djinn scroll
        --Marid Faction (Blue Djinn)
        player:setStorageValue(Storage.DjinnWar.MaridFaction.Mission01, 2)
        player:setStorageValue(Storage.DjinnWar.MaridFaction.Mission02, 2)       
        player:setStorageValue(Storage.DjinnWar.MaridFaction.Mission03, 3)
        player:setStorageValue(Storage.DjinnWar.MaridFaction.DoorToEfreetTerritory, 1)
        player:setStorageValue(Storage.OrcKingGreeting, 1)
        player:setStorageValue(Storage.DjinnWar.MaridFaction.DoorToLamp, 1)
        player:setStorageValue(Storage.DjinnWar.ReceivedLamp, 1)
        player:addAchievement('Marid Ally')       
        player:addItem(2146, 3)
        player:addItem(2356, 1)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The Gods blessed you.. now you are one Marid Ally.")
    end
    
    if scroll == 14 then
        --Green Djinn scroll
        --Efreet Faction (Green Djinn)
        player:setStorageValue(Storage.DjinnWar.Faction.Efreet, 1)
        player:setStorageValue(Storage.DjinnWar.Faction.Greeting, 0)
        player:setStorageValue(Storage.DjinnWar.EfreetFaction.Start, 1)
        player:setStorageValue(Storage.DjinnWar.EfreetFaction.Mission01, 3)       
        player:setStorageValue(Storage.DjinnWar.EfreetFaction.Mission02, 3)
        player:setStorageValue(Storage.DjinnWar.EfreetFaction.Mission03, 3)
        player:setStorageValue(Storage.DjinnWar.EfreetFaction.DoorToMaridTerritory, 1)
        player:addAchievement('Efreet Ally')
        player:setStorageValue(Storage.DjinnWar.EfreetFaction.DoorToLamp, 1)
        player:setStorageValue(Storage.DjinnWar.ReceivedLamp, 1)
        player:addItem(2356, 1)       
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The Gods blessed you.. now you are one Efreet Ally.")
    end
    
    if scroll == 15 then
        --Angel outfit scroll
        player:addOutfit(413, 0)
        player:addOutfit(414, 0)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The Gods blessed you with Angel outfit.")
    end
    
    if scroll == 16 then
        --Warrior Mount outfit scroll
        player:addOutfit(464, 0)
        player:addOutfit(465, 0)
        player:addOutfitAddon(464, 3)
        player:addOutfitAddon(465, 3)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The Gods blessed you with Warrior Mount outfit.")
    end
    
    
    if scroll == 17 then
        --Demon Hunter Mount outfit scroll
        player:addOutfit(471, 0)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The Gods blessed you with Demon Hunter Mount outfit.")
    end
    
    if scroll == 18 then
        --Assassin Mount outfit scroll
        player:addOutfit(466, 0)
        player:addOutfit(467, 0)
        player:addOutfitAddon(466, 3)
        player:addOutfitAddon(467, 3)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The Gods blessed you with Assassin Mount outfit.")
    end
        
    
    if scroll == 19 then
        --Shaman Mount outfit scroll
        player:addOutfit(463, 0)
        player:addOutfit(468, 0)
        player:addOutfitAddon(463, 3)
        player:addOutfitAddon(468, 3)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The Gods blessed you with Shaman Mount outfit.")
    end
    
    
    if scroll == 20 then
        --Blood Warior outfit scroll
        player:addOutfit(469, 0)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The Gods blessed you with Blood Warior outfit.")
    end
    
    if scroll == 21 then
        --Desert Rider outfit scroll
        player:addOutfit(470, 0)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The Gods blessed you with Desert Rider outfit.")
    end
    
    
    if scroll == 22 then
        --Summoner Mount outfit scroll
        player:addOutfit(472, 0)
        player:addOutfit(473, 0)
        player:addOutfitAddon(472, 3)
        player:addOutfitAddon(473, 3)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The Gods blessed you with Summoner Mount outfit.")
    end
    
    Item(item.uid):remove(1)
    return true
end
 
Lua:
    -- Xikini's edit.
    if (scroll == 13 or scroll == 14) and (player:hasAchievement("Marid Ally") or player:hasAchievement("Efreet Ally")) then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, "You have already chosen whom will be your ally. You cannot change your decision.")
        return true
    end
 
Lua:
    -- Xikini's edit.
    if (scroll == 13 or scroll == 14) and (player:hasAchievement("Marid Ally") or player:hasAchievement("Efreet Ally")) then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, "You have already chosen whom will be your ally. You cannot change your decision.")
        return true
    end
sorry bro, i swear i try to learn but i always do it wrong, thx
 
Back
Top