• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved Reduce Script

_Aion_

Nothing Else
Joined
Jan 19, 2010
Messages
401
Solutions
4
Reaction score
10
Location
Jequie,Bahia,Brazil
Hello, someone can reduce this scripts?
I'm learning LUA and made this "big script" or if you can give another script...
my script check if player have XX storage, if true, gain addons.

PS: i made this script because my Addon Quest not work, when relog back to zero addon.

Code:
function onLogin(cid)

if getPlayerStorageValue(cid, 18913) == 1 then
doPlayerAddOutfit(cid,128,3)
doPlayerAddOutfit(cid,136,3)
elseif getPlayerStorageValue(cid, 18914) == 1 then
doPlayerAddOutfit(cid,129,3)
doPlayerAddOutfit(cid,137,3)
elseif getPlayerStorageValue(cid, 18915) == 1 then
doPlayerAddOutfit(cid,130,3)
doPlayerAddOutfit(cid,138,3)
elseif getPlayerStorageValue(cid, 18916) == 1 then
doPlayerAddOutfit(cid,131,3)
doPlayerAddOutfit(cid,139,3)
elseif getPlayerStorageValue(cid, 18917) == 1 then
doPlayerAddOutfit(cid,132,3)
doPlayerAddOutfit(cid,140,3)
elseif getPlayerStorageValue(cid, 18918) == 1 then
doPlayerAddOutfit(cid,133,3)
doPlayerAddOutfit(cid,141,3)
elseif getPlayerStorageValue(cid, 18919) == 1 then
doPlayerAddOutfit(cid,134,3)
doPlayerAddOutfit(cid,142,3)
elseif getPlayerStorageValue(cid, 18920) == 1 then
doPlayerAddOutfit(cid,143,3)
doPlayerAddOutfit(cid,147,3)
elseif getPlayerStorageValue(cid, 18921) == 1 then
doPlayerAddOutfit(cid,144,3)
doPlayerAddOutfit(cid,148,3)
elseif getPlayerStorageValue(cid, 18922) == 1 then
doPlayerAddOutfit(cid,145,3)
doPlayerAddOutfit(cid,149,3)
elseif getPlayerStorageValue(cid, 18923) == 1 then
doPlayerAddOutfit(cid,146,3)
doPlayerAddOutfit(cid,150,3)
elseif getPlayerStorageValue(cid, 18924) == 1 then
doPlayerAddOutfit(cid,151,3)
doPlayerAddOutfit(cid,155,3)
elseif getPlayerStorageValue(cid, 18925) == 1 then
doPlayerAddOutfit(cid,152,3)
doPlayerAddOutfit(cid,156,3)
elseif getPlayerStorageValue(cid, 18926) == 1 then
doPlayerAddOutfit(cid,153,3)
doPlayerAddOutfit(cid,157,3)
elseif getPlayerStorageValue(cid, 18927) == 1 then
doPlayerAddOutfit(cid,154,3)
doPlayerAddOutfit(cid,158,3)
elseif getPlayerStorageValue(cid, 18928) == 1 then
doPlayerAddOutfit(cid,251,3)
doPlayerAddOutfit(cid,252,3)
elseif getPlayerStorageValue(cid, 18929) == 1 then
doPlayerAddOutfit(cid,268,3)
doPlayerAddOutfit(cid,269,3)
elseif getPlayerStorageValue(cid, 18930) == 1 then
doPlayerAddOutfit(cid,273,3)
doPlayerAddOutfit(cid,270,3)
elseif getPlayerStorageValue(cid, 18931) == 1 then
doPlayerAddOutfit(cid,278,3)
doPlayerAddOutfit(cid,279,3)
elseif getPlayerStorageValue(cid, 18932) == 1 then
doPlayerAddOutfit(cid,289,3)
doPlayerAddOutfit(cid,288,3)
elseif getPlayerStorageValue(cid, 18933) == 1 then
doPlayerAddOutfit(cid,325,3)
doPlayerAddOutfit(cid,324,3)
elseif getPlayerStorageValue(cid, 18934) == 1 then
doPlayerAddOutfit(cid,367,3)
doPlayerAddOutfit(cid,366,3)
end
return true
end

and here my addonchest(works but when relog desappear, you can help too)?

Code:
local addons = {
        [8913] = {[0] = 136, [1] = 128, name = "Citizen"},
        [8914] = {[0] = 137, [1] = 129, name = "Hunter"},
        [8915] = {[0] = 138, [1] = 130, name = "Mage"},
        [8916] = {[0] = 139, [1] = 131, name = "Knight"},
        [8917] = {[0] = 140, [1] = 132, name = "Nobleman/Noblewoman"},
        [8918] = {[0] = 141, [1] = 133, name = "Summoner"},
        [8919] = {[0] = 142, [1] = 134, name = "Warrior"},
        [8920] = {[0] = 147, [1] = 143, name = "Barbarian"},
        [8921] = {[0] = 148, [1] = 144, name = "Druid"},
        [8922] = {[0] = 149, [1] = 145, name = "Wizard"},
        [8923] = {[0] = 150, [1] = 146, name = "Oriental"},
        [8924] = {[0] = 155, [1] = 151, name = "Pirate"},
        [8925] = {[0] = 156, [1] = 152, name = "Assassin"},
        [8926] = {[0] = 157, [1] = 153, name = "Beggar"},
        [8927] = {[0] = 158, [1] = 154, name = "Shaman"},
        [8928] = {[0] = 252, [1] = 251, name = "Norseman/Norsewoman"},
        [8929] = {[0] = 269, [1] = 268, name = "Nightmare"},
        [8930] = {[0] = 270, [1] = 273, name = "Jester"},
        [8931] = {[0] = 279, [1] = 278, name = "Brotherhood"},
        [8932] = {[0] = 288, [1] = 289, name = "Demonhunter"},
        [8933] = {[0] = 324, [1] = 325, name = "Yalaharian"},
       [8934] = {[0] = 366, [1] = 367, name = "Wayfarer"}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
        if addons[item.uid] then
                local storage = item.uid + 10000
                if getPlayerStorageValue(cid, storage) == -1 then
                        doPlayerSendTextMessage(cid, 25, "Você achou o conjunto de addons ".. addons[item.uid].name ..".")
                        doPlayerAddOutfit(cid, addons[item.uid][getPlayerSex(cid)], 3)
                        setPlayerStorageValue(cid, storage, 1)
                else
                        doPlayerSendTextMessage(cid, 25, "Você já possui este addon.")
                end
                return true
        end
end

thanks and sorry for my bad english
 
Back
Top