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

addons quest script

Venn

Member
Joined
Aug 16, 2009
Messages
547
Reaction score
20
my script works fine but got some errors
for expample player dont have a citizen outfit. he need do quest to get citizen outfit, but he got items to make a citizen addons.
then he go get addons and with addons he get outfit.
it shouldnt be like that. if he havent citizen outfit he couldnt make a citizen addons.
how to fix that ?
my script:
Code:
  --[[
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        Addon System by Shawak (Maxi)
        Version v1.0
        ~~~ Rememeber ~~~~~~~~~~~~~~~
        This script set storagevalues
        to save the addons.
        Storage = 14000 + actionid of
        item.
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
]]--
       
local config = {

        [4001] = {
                name = "First Citizen Addon", -- name
                addon_type = 1,               -- addon
                outfit = {136,128},           -- female / male
                cost = 0,                     -- cost
                items = {{5878,100}},         -- items
        },
        [4002] = {
                name = "Second Citizen Addon",
                addon_type = 2,
                outfit = {136,128},
                cost = 0,
                items = {{5890,100},{5902,50},{2480,1}},
        },
        [4003] = {
                name = "First Hunter Addon",
                addon_type = 1,
                outfit = {137,129},
                cost = 0,
                items = {{5947,1},{5876,100},{5948,100},{5889,1},{5887,1},{5888,1},{5891,5}},
        },
        [4004] = {
                name = "Second Hunter Addon",
                addon_type = 2,
                outfit = {137,129},
                cost = 0,
                items = {{5875,1}},
        },
        [4005] = {
                name = "First Mage Addon",
                addon_type = 1,
                outfit = {138,130},
                cost = 0,
                items = {{5958,1}},
        },
        [4006] = {
                name = "Second Mage Addon",
                addon_type = 2,
                outfit = {138,130},
                cost = 0,
                items = {{5903,1}},
        },
        [4007] = {
                name = "First Knight Addon",
                addon_type = 1,
                outfit = {139,131},
                cost = 0,
                items = {{5880,100}},
        },
        [4008] = {
                name = "Second Knight Addon",
                addon_type = 2,
                outfit = {139,131},
                cost = 0,
                items = {{5893,100},{5924,1},{5885,1},{5887,1}},
        },
        [4009] = {
                name = "First Nobleman Addon",
                addon_type = 1,
                outfit = {140,132},
                cost = 150000,
                items = {},
        },
        [4010] = {
                name = "Second Nobleman Addon",
                addon_type = 2,
                outfit = {140,132},
                cost = 150000,
                items = {},
        },

        [4011] = {
                name = "First Summoner Addon",
                addon_type = 1,
                outfit = {141,133},
                cost = 0,
                items = {{5958,1}},
        },
        [4012] = {
                name = "Second Summoner Addon",
                addon_type = 2,
                outfit = {141,133},
                cost = 0,
                items = {{5894,70},{5911,20},{5883,40},{5905,30},{5904,15},{5882,40},{5881,60},{5886,10},{5922,35}},
        },
        [4013] = {
                name = "First Warrior Addon",
                addon_type = 1,
                outfit = {142,134},
                cost = 0,
                items = {{5899,100},{5925,100},{5884,1},{10020,1}},
        },
        [4014] = {
                name = "Second Warrior Addon",
                addon_type = 2,
                outfit = {142,134},
                cost = 0,
                items = {{5887,1},{5880,100}},
        },
        [4015] = {
                name = "First Barbarian Addon",
                addon_type = 1,
                outfit = {147,143},
                cost = 0,
                items = {{5885,1},{5884,1},{5911,50},{5910,50},{5886,10}},
        },
        [4016] = {
                name = "Second Barbarian Addon",
                addon_type = 2,
                outfit = {147,143},
                cost = 0,
                items = {{5892,1},{5880,100},{5893,50},{5876,50}},
        },
        [4017] = {
                name = "First Druid Addon",
                addon_type = 1,
                outfit = {148,144},
                cost = 0,
                items = {{5897,50},{5896,50}},
        },
        [4018] = {
                name = "Second Druid Addon",
                addon_type = 2,
                outfit = {148,144},
                cost = 0,
                items = {{5940,1},{5938,1},{5937,1},{5942,1},{5906,100}},
        },
        [4019] = {
                name = "First Wizard Addon",
                addon_type = 1,
                outfit = {149,145},
                cost = 0,
                items = {{2488,1},{2123,1},{2492,1},{2536,1}},
        },
        [4020] = {
                name = "Second Wizard Addon",
                addon_type = 2,
                outfit = {149,145},
                cost = 0,
                items = {{5922,50},},
        },
        [4021] = {
                name = "First Oriental Addon",
                addon_type = 1,
                outfit = {150,146},
                cost = 0,
                items = {{5945,1}},
        },
        [4022] = {
                name = "Second Oriental Addon",
                addon_type = 2,
                outfit = {150,146},
                cost = 0,
                items = {{5883,100},{5895,100},{5891,2},{5912,100}},
        },
        [4023] = {
                name = "First Pirate Addon",
                addon_type = 1,
                outfit = {155,151},
                cost = 0,
                items = {{6126,100},{6097,100},{6098,100}},
        },
        [4024] = {
                name = "Second Pirate Addon",
                addon_type = 2,
                outfit = {155,151},
                cost = 0,
                items = {{2385,1},{6098,1},{6095,1},{6096,1}},
        },
        [4025] = {
                name = "First Assassin Addon",
                addon_type = 1,
                outfit = {156,152},
                cost = 0,
                items = {{5898,30},{5882,10},{5881,30},{5895,20},{5905,20},{5906,10},{5885,1}},
        },
        [4026] = {
                name = "Second Assassin Addon",
                addon_type = 2,
                outfit = {156,152},
                cost = 0,
                items = {{5909,50},{5910,50},{5911,50},{5912,50},{5913,50},{5914,50},{5886,10}},
        },
        [4027] = {
                name = "First Beggar Addon",
                addon_type = 1,
                outfit = {157,153},
                cost = 20000,
                items = {{5883,100}},
        },
        [4028] = {
                name = "Second Beggar Addon",
                addon_type = 2,
                outfit = {157,153},
                cost = 0,
                items = {{6107,1}},
        },
        [4029] = {
                name = "First Shaman Addon",
                addon_type = 1,
                outfit = {158,154},
                cost = 0,
                items = {{3955,5},{5015,1}},
        },
        [4030] = {
                name = "Second Shaman Addon",
                addon_type = 2,
                outfit = {158,154},
                cost = 0,
                items = {{3966,5},{3967,5}},
        },
        [4031] = {
                name = "First Norseman Addon",
                addon_type = 1,
                outfit = {252,251},
                cost = 0,
                items = {{7290,5}},
        },
        [4032] = {
                name = "Second Norseman Addon",
                addon_type = 2,
                outfit = {252,251},
                cost = 0,
                items = {{7290,10}},
        },
        [4033] = {
                name = "First Nightmare Addon",
                addon_type = 1,
                outfit = {269,268},
                cost = 0,
                items = {{6500,500}},
        },
        [4034] = {
                name = "Second Nightmare Addon",
                addon_type = 2,
                outfit = {269,268},
                cost = 0,
                items = {{6500,1500}},
        },
        [4035] = {
                name = "First Jester Addon",
                addon_type = 1,
                outfit = {270,273},
                cost = 0,
                items = {{5879,1},{5878,4}},
        },
        [4036] = {
                name = "Second Jester Addon",
                addon_type = 2,
                outfit = {270,273},
                cost = 0,
                items = {{5909,5}},
        },
        [4037] = {
                name = "First Brotherhood Addon",
                addon_type = 1,
                outfit = {279,278},
                cost = 0,
                items = {{6500,500}},
        },
        [4038] = {
                name = "Second Brotherhood Addon",
                addon_type = 2,
                outfit = {279,278},
                cost = 0,
                items = {{6500,1500}},
        },
        [4039] = {
                name = "First Demonhunter Addon",
                addon_type = 1,
                outfit = {288,289},
                cost = 0,
                items = {{5527,500}},
        },
        [4040] = {
                name = "Second Demonhunter Addon",
                addon_type = 2,
                outfit = {288,289},
                cost = 0,
                items = {{5954,500}},
        },
        [4041] = {
                name = "Good Yalaharian Addon (You can choose only one Yalaharian Addon!)",
                addon_type = 1,
                outfit = {324,325},
                cost = 0,
                items = {{9955,1}},
        },
        [4041] = {
                name = "Evil Yalaharian Addon (You can choose only one Yalaharian Addon!)",
                addon_type = 2,
                outfit = {324,325},
                cost = 0,
                items = {{9955,1}},
        },
        [4042] = {
                name = "First Warmaster Addon",
                addon_type = 1,
                outfit = {336,335},
                cost = 0,
                items = {{11116,1}},
        },
        [4043] = {
                name = "Second Warmaster Addon",
                addon_type = 2,
                outfit = {336,335},
                cost = 0,
                items = {{11115,1}},
        },
        [4044] = {
                name = "First Wayfarer Addon",
                addon_type = 1,
                outfit = {366,367},
                cost = 0,
                items = {{12657,1}},
        },
        [4045] = {
                name = "Second Wayfarer Addon",
                addon_type = 2,
                outfit = {366,367},
                cost = 0,
                items = {{12656,1}},
        },

} -------- config end -------
local storage = 14000
function onUse(cid, item, fromPosition, itemEx, toPosition)
        local addon, removeItems, removeMoney = config[item.actionid], 0, 0
         if getPlayerStorageValue(cid, storage + item.actionid) ~= 1 then
                if getPlayerMoney(cid) >= addon.cost then
                        removeMoney = 1
                end
                if #addon.items > 0 then
                        for i = 1, #addon.items do
                                if getPlayerItemCount(cid, addon.items[i][1]) >= addon.items[i][2] then
                                        removeItems = removeItems+1
                                end
                        end
                end
                if removeMoney == 1 and removeItems == #addon.items then
                        for i = 1, #addon.items do
                                doPlayerRemoveItem(cid, addon.items[i][1], addon.items[i][2])
                        end
                        doPlayerRemoveMoney(cid, addon.cost)
                        doPlayerAddOutfit(cid, addon.outfit[1], addon.addon_type)
                        doPlayerAddOutfit(cid, addon.outfit[2], addon.addon_type)
                        setPlayerStorageValue(cid, storage + item.actionid, 1)
                        doPlayerSendTextMessage(cid, 21, "Now you can use the "..addon.name..".")
                else
                        if addon.cost ~= 0 then
                                msg = "You need "..addon.cost.." gold coins and "
                        else
                                msg = "You need "
                        end
                        if #addon.items > 0 then
                                for i = 1, #addon.items do
                                        msg = msg..""..addon.items[i][2].."x "..getItemNameById(addon.items[i][1]).." "
                                end
                        end
                        doPlayerSendTextMessage(cid, 21, msg.."for the "..addon.name..".")
                end
        else
                doPlayerSendTextMessage(cid, 21, "You already have the "..addon.name..".")
        end
        return TRUE
end
 
If want more addons, you can add this easy.

LUA:
  function onUse(cid, item, frompos, item2, topos)

         if item.uid == 12001 then
             if (getPlayerStorageValue(cid,12009) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Hunter Outfit!")
                doPlayerAddOutfitId(cid,1,3)
                setPlayerStorageValue(cid,12009,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Hunter Outfit.")
end

       elseif item.uid == 12002 then
              if (getPlayerStorageValue(cid,12011) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Mage Outfit!")
                doPlayerAddOutfitId(cid,3,3)
                setPlayerStorageValue(cid,12011,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Mage Outfit.")
end

       elseif item.uid == 12003 then
              if (getPlayerStorageValue(cid,12012) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Knight Outfit!")
                doPlayerAddOutfitId(cid,4,3)
                setPlayerStorageValue(cid,12012,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Knight Outfit.")
        end


    elseif item.uid == 12004 then
           if (getPlayerStorageValue(cid,12013) == -1) and getPlayerSex(cid) == 1 then
                doPlayerSendTextMessage(cid,21,"You now have the Nobleman Outfit!")
                doPlayerAddOutfitId(cid,5,3)
                setPlayerStorageValue(cid,12013,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
                else if(getPlayerStorageValue(cid,12013) == -1) and getPlayerSex(cid) == 0 then
                doPlayerSendTextMessage(cid,21,"You now have the Noblewoman Outfit!")
                doPlayerAddOutfitId(cid,5,3)
                setPlayerStorageValue(cid,12013,1)
        else
                doPlayerSendTextMessage(cid,25,"You Already have this outfit.")        
        end
           end

   
   elseif item.uid == 12005 then
        if (getPlayerStorageValue(cid,12014) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Summoner Outfit!")
                doPlayerAddOutfitId(cid,6,3)
                setPlayerStorageValue(cid,12014,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Summoner Outfit.")
        end

   elseif item.uid == 12006 then
          if (getPlayerStorageValue(cid,12015) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Warrior Outfit!")
                doPlayerAddOutfitId(cid,7,3)
                setPlayerStorageValue(cid,12015,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Warrior Outfit.")
        end

   elseif item.uid == 12007 then
          if (getPlayerStorageValue(cid,12016) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Barbarian Outfit!")
                doPlayerAddOutfitId(cid,8,3)
                setPlayerStorageValue(cid,12016,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Barbarian Outfit.")
        end

   elseif item.uid == 12008 then
          if (getPlayerStorageValue(cid,12017) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Druid Outfit!")
                doPlayerAddOutfitId(cid,9,3)
                setPlayerStorageValue(cid,12017,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Druid Outfit.")
        end

   elseif item.uid == 12009 then
          if (getPlayerStorageValue(cid,12018) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Wizard Outfit!")
                doPlayerAddOutfitId(cid,10,3)
                setPlayerStorageValue(cid,12018,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Wizard Outfit.")
        end

   elseif item.uid == 12010 then
          if (getPlayerStorageValue(cid,12019) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Oriental Outfit!")
                doPlayerAddOutfitId(cid,11,3)
                setPlayerStorageValue(cid,12019,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Oriental Outfit.")
        end

   elseif item.uid == 12011 then
          if (getPlayerStorageValue(cid,12020) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Pirate Outfit!")
                doPlayerAddOutfitId(cid,12,3)
                setPlayerStorageValue(cid,12020,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Pirate Outfit.")
        end

   elseif item.uid == 12012 then
          if (getPlayerStorageValue(cid,12031) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Assassin Outfit!")
                doPlayerAddOutfitId(cid,13,3)
                setPlayerStorageValue(cid,12031,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Assassin Outfit.")
        end

   elseif item.uid == 12013 then
          if (getPlayerStorageValue(cid,12022) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Beggar Outfit!")
                doPlayerAddOutfitId(cid,14,3)
                setPlayerStorageValue(cid,12022,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Beggar Outfit.")
        end

   elseif item.uid == 12014 then
          if (getPlayerStorageValue(cid,12023) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Shaman Outfit!")
                doPlayerAddOutfitId(cid,15,3)
                setPlayerStorageValue(cid,12023,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Shaman Outfit.")
        end

   elseif item.uid == 12015 then
           if (getPlayerStorageValue(cid,12024) == -1) and getPlayerSex(cid) == 1 then
                doPlayerSendTextMessage(cid,21,"You now have the Norseman Outfit!")
                doPlayerAddOutfitId(cid,16,3)
                setPlayerStorageValue(cid,12024,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
                else if(getPlayerStorageValue(cid,12024) == -1) and getPlayerSex(cid) == 0 then
                doPlayerSendTextMessage(cid,21,"You now have the Norsewoman Outfit!")
                doPlayerAddOutfitId(cid,16,3)
                setPlayerStorageValue(cid,12024,1)
        else
                doPlayerSendTextMessage(cid,25,"You Already have this outfit.")        
          end
           end


   elseif item.uid == 12016 then
          if (getPlayerStorageValue(cid,12025) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Nightmare Outfit!")
                doPlayerAddOutfitId(cid,17,3)
                setPlayerStorageValue(cid,12025,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Nightmare Outfit.")
        end

   elseif item.uid == 12017 then
          if (getPlayerStorageValue(cid,12026) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Jester Outfit!")
                doPlayerAddOutfitId(cid,18,3)
                setPlayerStorageValue(cid,12026,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Jester Outfit.")
        end

   elseif item.uid == 12018 then
          if (getPlayerStorageValue(cid,12027) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Brotherhood Outfit!")
                doPlayerAddOutfitId(cid,19,3)
                setPlayerStorageValue(cid,12027,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Brotherhood Outfit.")
        end

   elseif item.uid == 12019 then
          if (getPlayerStorageValue(cid,12028) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Demonhunter Outfit!")
                doPlayerAddOutfitId(cid,20,3)
                setPlayerStorageValue(cid,12028,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Demonhunter Outfit.")
        end

   elseif item.uid == 12020 then
          if (getPlayerStorageValue(cid,12029) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Yalahari Outfit!")
                doPlayerAddOutfitId(cid,21,3)
                setPlayerStorageValue(cid,12029,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Yalahari Outfit.")
        end

    end
        return TRUE
end

Rep++ if help.
 
im my ot player need do quest do get outfits but for addons i god switch
and if player get items do take addon but havent outfit and will take addon he get also outfit. and its wrong
 
Back
Top