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

change item for storage

carlinhous1996

New Member
Joined
Apr 14, 2022
Messages
54
Reaction score
3
this script makes people with item 10142 go through a certain port. How do I replace this item with the storage
40210) >= 6 then
it's possible?

Lua:
if item.uid == 5231 then
        local items = {    --[Quantidade] = ITEMID,
                    [1] = 10142,
               
                }
           
        for count, id in pairs(items) do
            if getPlayerItemCount(cid, id) < count then
                doPlayerSendTextMessage(cid,20, "Voce nao tem "..(count - getPlayerItemCount(cid, id)).." ".. getItemNameById(id).." para passar.")
                doSendMagicEffect(fromPosition, CONST_ME_POFF)
                return false
            end
        end
        doorEnter(cid, item, toPosition)
        return true
    end
 
Lua:
if item.uid == 5231 then
            if getPlayerStorageValue(cid, 40210) < 6 then
                doPlayerSendTextMessage(cid,20, "Voce nao tem permissão para passar.")
                doSendMagicEffect(fromPosition, CONST_ME_POFF)
                return false
            end
        doorEnter(cid, item, toPosition)
      return true
end
 
Last edited:
Lua:
local storages = {
    [1] = { storage = 40210, value = 6 },
}

if item.uid == 5231 then
    for i = 1, #storages do
        if getPlayerStorageValue(cid, storages[i].storage) < storages[i].value then
            doPlayerSendTextMessage(cid, 20, "You are not allowed to pass.")
            doSendMagicEffect(fromPosition, CONST_ME_POFF)

            return false
        end
    end
    doorEnter(cid, item, toPosition)

    return true
end
Post automatically merged:

You can add more storages to your list. For example:
Lua:
local storages = {
    [1] = { storage = 40210, value = 6 },
    [2] = { storage = 40211, value = 5 },
}
If the person has the value 5 in storage 40211, he can pass.
 
Last edited:
Lua:
armazenamentos locais = {
    [1] = { armazenamento = 40210, valor = 6 },
}

se item.uid == 5231 então
    para i = 1, #storages do
        if getPlayerStorageValue(cid, storages[i].storage) < storages[i].value então
            doPlayerSendTextMessage(cid, 20, "Você não pode passar.")
            doSendMagicEffect(fromPosition, CONST_ME_POFF)

            retorna falso
        fim
    fim
    portaEnter(cid, item, toPosition)

    retornar verdadeiro
fim
[/CÓDIGO]
[automerge]1670955727[/automerge]
Você pode adicionar mais armazenamentos à sua lista. Por exemplo:
[CODE=lua]armazenamentos locais = {
    [1] = { armazenamento = 40210, valor = 6 },
    [2] = { armazenamento = 40211, valor = 5 },
}[/CÓDIGO]
Se a pessoa tiver o valor 5 no depósito 40211, pode passar.
[/QUOTE]
muito bom!
thanks
obrigado irmao.
sempre me ajudando kkkk
 

Similar threads

Back
Top