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

avesta 7.4 gate of experience onstepout

Ganjita

Active Member
Joined
Dec 15, 2009
Messages
494
Reaction score
37
someone can help me?, i have a problem when i try move from door of lvl , my character get a freeze and the console show that error (see pic), im use avesta rev 94 and my closingdoor.lua is that

Code:
function onStepOut(cid, item, pos)
    if(item.actionid == 0) then
        return TRUE
    end

    local topos = getPlayerPosition(cid)
    doRelocate(pos, topos)

    local tmpPos = {x=pos.x, y=pos.y, z=pos.z, stackpos=-1}
    local tileCount = getTileThingByPos(tmpPos)
    local i = 1
    local tmpItem = {uid = 1}

    while(tmpItem.uid ~= 0 and i < tileCount) do
        tmpPos.stackpos = i
        tmpItem = getTileThingByPos(tmpPos)
        if(tmpItem.uid ~= item.uid and tmpItem.uid ~= 0) then
            doRemoveItem(tmpItem.uid)
        else
            i = i + 1
        end
    end

    doTransformItem(item.uid, item.itemid-1)
    return TRUE
end

if someone can help me, thanks in advance, greetings
 

Attachments

It's for closing door horizontal:

Code:
function onStepOut(cid, item, topos, frompos)
        if(item.actionid == 0) then
                -- This is not a special door
                return TRUE
        end

        doRelocate(frompos, {x=frompos.x+1, y=frompos.y, z=frompos.z})

        local tmpPos = {x=frompos.x, y=frompos.y, z=frompos.z, stackpos=-1}
        local tileCount = getTileThingByPos(tmpPos)
        local i = 1
        local tmpItem = {uid = 1}

        while(tmpItem.uid ~= 0 and i < tileCount) do
                tmpPos.stackpos = i
                tmpItem = getTileThingByPos(tmpPos)
                if(tmpItem.uid ~= item.uid and tmpItem.uid ~= 0) then
                        doRemoveItem(tmpItem.uid)
                else
                        i = i + 1
                end
        end

        doTransformItem(item.uid, item.itemid-1)
        return TRUE
end

You should add new script to second gate for vertical as well.
Horizontal means you get relocated to the right, vertical to the south.

In vertical script everything is same beside this line:
Code:
doRelocate(frompos, {x=frompos.x, y=frompos.y+1, z=frompos.z})
 
Last edited:
Back
Top