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

Lua Reformulation of Script

Djowz

Djowz's Style
Joined
Dec 29, 2011
Messages
47
Reaction score
1
Good people, I wonder if someone could rephrase my scirpt with the following things.
- I would like that when the time is over 30 minutes, the four demons summoned were removed.
- that when the player makes the quest appears msg "You Found a Bag"
- player and when someone is doing the quest after another msg appears that the 30 minutes it has not passed in any case he can only do the quest after 30 minutes.

and here is the script.
Code:
local cfg = {    playerStorage = 60666,
    globalStorage = 60664,
    minutes = 30,
    positions = {
        {x=33060, y=31623, z=15},
        {x=33066, y=31623, z=15},
        {x=33060, y=31627, z=15},
        {x=33066, y=31627, z=15}
    },
    bagItems = {
        {2165}, {2151, 2}, {2230}, {2229}, {1951}, {2091, 1, 6010}
    }
}
function onUse(cid, item, frompos, item2, topos)
    if getGlobalStorageValue(cfg.globalStorage) < 1 and getPlayerStorageValue(cid, cfg.playerStorage) < 1 then
        for _, t in pairs(cfg.positions) do
            doSummonCreature("Demon", t)
        end
        local bag = doPlayerAddItem(cid, 1987, 1)
        for _, t in pairs(cfg.bagItems) do
            local newItem = doAddContainerItem(bag, t[1], t[2] or 1)
            if t[3] then
                doItemSetAttribute(newItem, "aid", t[3])
            end
        end
        setPlayerStorageValue(cid, cfg.playerStorage, 1)
        setGlobalStorageValue(cfg.globalStorage, 1)
        addEvent(setGlobalStorageValue, cfg.minutes * 60000, 60664, -1)
    end
end

Hugs Djowzs
 
Back
Top