• 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 ROPE TILE LIKE OLD TIBIA

jigsaw

Member
Joined
Dec 21, 2008
Messages
137
Solutions
4
Reaction score
16
Good afternoon everyone, here is what I want:

When I throw an object at the rope tile (the one which we use rope) it still works.

What I want is when someone throw something at that tile, rope must no work (like old days).

Is there any script to do that?

Thanks in advance, guys!
 
Yes there is script to do that which must be written or edited. If you want whole script not help with current then go to requests. Read rules next time.
 
Post your current script and your server version, we got no crystal balls!!

Take it easy, my friend. I'm not at home right now... once I get home I will post it.

Thexamx, I don't want the full script. I just need help with mine. Which I will post here today at midnight maybe.

I'm aware with the rules, by the way.

Thank you guys for responding.

I use OTX Server 7.72 path. compiled 32bits

There it is, my friend.

My action.xml

Could you help me now? Is there another file that I must upload here?

Thanks in advance.
 

Attachments

Last edited by a moderator:
We need your data\actions\lib\actions.lua and data\actions\scripts\tools\rope.lua
Sorry.. I thought that I uploaded the right one.

Now there it is.

Edit:

Thank you WibbenZ, I'm at work right now.. tonight I will post here.
 

Attachments

Last edited:
delete line 107
toPosition.stackpos = STACKPOS_GROUND
I did it and it not work with the server running. I just reloaded the acitons. Now I will close the server and run it up again a test it.

Thank you

I did it and it not work with the server running. I just reloaded the acitons. Now I will close the server and run it up again a test it.

Thank you
Didnt work...
 
Last edited by a moderator:
@jigsaw
Try 1 instead of 255. If this doesn't work try this one:
Peonso, I tried both..I download the actions.lua and the message when using rope was the same.. you cannot use this object.

Its okay though.. not big deal.. I will leave it this way..

thank you so much for you help mate.
 
This is probably the solution you are looking for:

Lua:
TOOLS.ROPE = function(cid, item, fromPosition, itemEx, toPosition)
    if(toPosition.x == CONTAINER_POSITION) then
        doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
        return true
    end

    toPosition.stackpos = STACKPOS_GROUND
    errors(false)
    local ground = getThingFromPos(toPosition)
    errors(true)
    if(isInArray(SPOTS, ground.itemid)) then
        local hole = getThingFromPos({x = toPosition.x, y = toPosition.y, z = toPosition.z + 1, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE})
        if( ( isPlayer(hole.uid) and ( not isPlayerGhost(hole.uid) or getPlayerGhostAccess(cid) >= getPlayerGhostAccess(hole.uid) ) ) or hole.itemid > 0 ) then
            return false
        else
            doTeleportThing(cid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z - 1}, false)
            return true
        end
    elseif(isInArray(ROPABLE, itemEx.itemid)) then
        local canOnlyRopePlayers = getBooleanFromString(getConfigValue('canOnlyRopePlayers'))
        local hole = getThingFromPos({x = toPosition.x, y = toPosition.y, z = toPosition.z + 1, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE})
        if(canOnlyRopePlayers) then
            if(isPlayer(hole.uid) and (not isPlayerGhost(hole.uid) or getPlayerGhostAccess(cid) >= getPlayerGhostAccess(hole.uid))) then
                doTeleportThing(hole.uid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z}, false)
            else
                doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
            end
        else
            if(hole.itemid > 0) then
                doTeleportThing(hole.uid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z}, false)
            else
                doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
            end
        end

        return true
    end

    return false
end
 
This is probably the solution you are looking for:

Lua:
TOOLS.ROPE = function(cid, item, fromPosition, itemEx, toPosition)
    if(toPosition.x == CONTAINER_POSITION) then
        doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
        return true
    end

    toPosition.stackpos = STACKPOS_GROUND
    errors(false)
    local ground = getThingFromPos(toPosition)
    errors(true)
    if(isInArray(SPOTS, ground.itemid)) then
        local hole = getThingFromPos({x = toPosition.x, y = toPosition.y, z = toPosition.z + 1, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE})
        if( ( isPlayer(hole.uid) and ( not isPlayerGhost(hole.uid) or getPlayerGhostAccess(cid) >= getPlayerGhostAccess(hole.uid) ) ) or hole.itemid > 0 ) then
            return false
        else
            doTeleportThing(cid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z - 1}, false)
            return true
        end
    elseif(isInArray(ROPABLE, itemEx.itemid)) then
        local canOnlyRopePlayers = getBooleanFromString(getConfigValue('canOnlyRopePlayers'))
        local hole = getThingFromPos({x = toPosition.x, y = toPosition.y, z = toPosition.z + 1, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE})
        if(canOnlyRopePlayers) then
            if(isPlayer(hole.uid) and (not isPlayerGhost(hole.uid) or getPlayerGhostAccess(cid) >= getPlayerGhostAccess(hole.uid))) then
                doTeleportThing(hole.uid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z}, false)
            else
                doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
            end
        else
            if(hole.itemid > 0) then
                doTeleportThing(hole.uid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z}, false)
            else
                doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
            end
        end

        return true
    end

    return false
end

Didn't work.
 
You substituted the TOOLS.ROPE in your actions.lua with this? Does it return an error or something? Can you put a print("testing"); after the function declaration to see if it is even running?
 
You substituted the TOOLS.ROPE in your actions.lua with this? Does it return an error or something? Can you put a print("testing"); after the function declaration to see if it is even running?
hello.. yes i did it. it does not work. must be something with libs i guess,ty anyway

its not a big issue anyway.. thank you
 
Back
Top