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

Solved Function when remove all items remove the container

silveralol

Advanced OT User
Joined
Mar 16, 2010
Messages
1,480
Solutions
9
Reaction score
211
Hello folks, I'm making some script, I need some function that remove the container when all items is removed from inside..
another problem ... I have some bugs if I create a item with decay time and send it to my depot, if I send the item and logout the item stop the decay...

Someone with c++ knowledge can help me with something? I want to understand what some functions do, and how use..
so much thanks
 
I have no idea why you are still bumping, when i provided you with a solution that work.
 
I'm sorry for that, I finally understand where to put it
you said movements D: before, then I don't put in there, so now I find the correct place
 
I did not say movement, in The event folder you should enable onMoveItem and paste the code.
 
Try this:

Code:
    local parent = item:getParent()
    if fromPosition.x == CONTAINER_POSITION and parent.isContainer and parent:getId() == 1988 then
       if parent:getSize() <= 1 then
           parent:remove()
       end
    end
 
Try this:

Code:
    local parent = item:getParent()
    if fromPosition.x == CONTAINER_POSITION and parent.isContainer and parent:getId() == 1988 then
       if parent:getSize() <= 1 then
           parent:remove()
       end
    end
nothing happens, inside in another container or on the ground
 
Back
Top