• 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 Accesing mailbox from LUA

Tejonte

Member
Joined
Feb 27, 2018
Messages
19
Reaction score
6
I'm trying to make a spell that sends, items on the ground to a specific depot (I frankestained, disintegrate and exori flam, to get item data, that part works flawlessly), but i cant access mailbox functions from the lua file even if i make it public, my c++ is beyond poor. I know this is a beyond noob question, but I wasn't able to google my way out of this.


Lua:
local dead_human = {
    4240, 4241, 4242, 4247, 4248
}
local removalLimit = 10


function onCastSpell(creature, variant)
    local position = variant:getPosition()
    local tile = Tile(position)
    if tile then
        local items = tile:getItems()
        if items then
            for i, item in ipairs(items) do
                if item:getType():isMovable() and item:getActionId() == 0 and not table.contains(dead_human, item:getId()) then

                    mailbox:getDestination(item,"Mierdaseca","Carlin")
                    mailbox:sendItem(item)
                    broadcastMessage(tostring(item))
                end

                if i == removalLimit then
                    break
                end
            end
        end
    end

    position:sendMagicEffect(CONST_ME_POFF)
    return true
end
 
Back
Top