• 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 trashable exceptions

warriorfrog

Active Member
Joined
Jul 29, 2015
Messages
334
Reaction score
35
I have this rope system made by Zothion...
It's just like old tibia... You can not use rope if some player trash the hole, with gps,worms,potions...
I love it to PvP but it beeing sick to normal playing

I have to add 2 execeptions:
1- If player is in the hole can get up, on this system if i'm on the hole i can not use rope in myserlf, i need to get out to use
2- Add a list of items that rope can ignore de get up, i'll add some grass border, stones, so i can get my maps beatifull with this system running
For example if i bleed on hole
11:21 You see a pool of blood.
ItemID: [2018].
DecayTo: [0].

I can not get up, i need to change this stuffs...
Anybody know how to do it? or one of it?

Code:
-- Rope Like was on 7x tibia version (credits: https://otland.net/members/zothion.201437/)
function onUse(cid, item, fromPosition, itemEx, toPosition)
   if(toPosition.x == CONTAINER_POSITION) then
       doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
       return true
   end
   local tmp = getTileThingByPos({x = toPosition.x, y = toPosition.y, z = toPosition.z, stackpos = 1})
       if tmp and tmp.itemid ~= 0 and tmp.uid < 125000 or isPlayer(tmp.uid) then
       return false
   end

   toPosition.stackpos = STACKPOS_GROUND
   local itemGround = getThingFromPos(toPosition)
   if(isInArray(SPOTS, itemGround.itemid)) then
       doTeleportThing(cid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z - 1}, false)
       return true
   elseif(isInArray(ROPABLE, itemEx.itemid)) then
       local hole = getThingFromPos({x = toPosition.x, y = toPosition.y, z = toPosition.z + 1, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE})
       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

       return true
   end

   return false
end
 
I have this rope system made by Zothion...
It's just like old tibia... You can not use rope if some player trash the hole, with gps,worms,potions...
I love it to PvP but it beeing sick to normal playing

I have to add 2 execeptions:
1- If player is in the hole can get up, on this system if i'm on the hole i can not use rope in myserlf, i need to get out to use
2- Add a list of items that rope can ignore de get up, i'll add some grass border, stones, so i can get my maps beatifull with this system running
For example if i bleed on hole
11:21 You see a pool of blood.
ItemID: [2018].
DecayTo: [0].

I can not get up, i need to change this stuffs...
Anybody know how to do it? or one of it?

Code:
-- Rope Like was on 7x tibia version (credits: https://otland.net/members/zothion.201437/)
function onUse(cid, item, fromPosition, itemEx, toPosition)
   if(toPosition.x == CONTAINER_POSITION) then
       doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
       return true
   end
   local tmp = getTileThingByPos({x = toPosition.x, y = toPosition.y, z = toPosition.z, stackpos = 1})
       if tmp and tmp.itemid ~= 0 and tmp.uid < 125000 or isPlayer(tmp.uid) then
       return false
   end

   toPosition.stackpos = STACKPOS_GROUND
   local itemGround = getThingFromPos(toPosition)
   if(isInArray(SPOTS, itemGround.itemid)) then
       doTeleportThing(cid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z - 1}, false)
       return true
   elseif(isInArray(ROPABLE, itemEx.itemid)) then
       local hole = getThingFromPos({x = toPosition.x, y = toPosition.y, z = toPosition.z + 1, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE})
       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

       return true
   end

   return false
end
I think this already contains some type of list to ignore some special items.
atleast whats based on this line "elseif(isInArray(ROPABLE, itemEx.itemid)) then"
can you post your data\lib\000-constant.lua

Edit:
I might been stupid that is when you rope from above the hole
 
I think this already contains some type of list to ignore some special items.
atleast whats based on this line "elseif(isInArray(ROPABLE, itemEx.itemid)) then"
can you post your data\lib\000-constant.lua

Edit:
I might been stupid that is when you rope from above the hole

I don't understand, that is not the normal rope system, that is a custom script based on tibia 7.2 if you trash the rope hole, you cant get up until untrash, but i wanted to add a few exceptions, like player can do rope if he is on the hole and a few items
 
Back
Top