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

TFS 1.X+ [The OTServBR based on TFS 1.3] - Stacked Move Items Disappear [Movement]

Sir Richard

New Member
Joined
Jun 10, 2009
Messages
19
Reaction score
3
Location
Brazil
Hey there!

This code is supposed to teleport items moved to a certain teleport and then be moved back, it is working just fine, except for one thing:

Stacked items get teleported nowhere/disappear.

What should I change in order to get all items (stackable or non stackable) being teleported to the correct destination?

Code:
function onAddItem(moveitem, tileitem, position)
    local setting = ItemTeleports[tileitem.actionid]
    if not setting then
        return true
    end

    moveitem:moveTo(setting.destination)
    setting.destination:sendMagicEffect(setting.effect)
    return true
end
 
moveitem:getCount() and moveitem:getItemId()

Hah! Worked just fine, thanks a lot!

But still... Another question comes to mind: what if the item has an actionid, uid, text (book/trophy) or special condition (imbuement, custom edits...) on it? lol

Wouldn't it be easier to just move it anyway?

Now that I know how to check the count of the item, is there a way to use that on the moveTo() function?
Post automatically merged:

Nevermind, I got it! Thanks again, mate! :D
 
Last edited:
Sure!

I simply added this:

Code:
    moveitem:moveTo(setting.destination, moveitem:getCount())

But one thing still bothers me, if the item is a teleport in the sources (any item that has teleport coordinates on the map editor), it will not work for stackable items ONLY! Bummer, but still works for other items, unless they are under/above a teleport, which always has the top priority, as far as I have seen, and since I won't be making any changes to the sources, that's it. :p
 
Back
Top