• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Moving a stack of items script

Erevius

It Was A Good Day
Joined
Feb 12, 2010
Messages
157
Reaction score
7
Location
Poland/Olsztyn
Well, I made a script for walls that appear when you use one of levers.
img1ux.png

The wall id is changing:
img2p.png


I also made that, when a creature is on a opened wall position, while clicking on the lever, the creature moves 1 sqm south.
img1be.png

img2s.png

What should I do for moveing a stack of items?

Please, help me!
<<Sorry for my english if here's any misstake>>
 
Last edited:
use doRelocate(fromPos, toPos), but beware of players who are trying to make the server lag by stacking hundreds of items on 1 tile
 
no, have you even tried using doRelocate? it moves all creatures and moveable items from fromPos to toPos, and doesn't require stackpos as parameter
 
dont make this a problem
LUA:
for i=1,k(stacks) do
stackpos = i
if item.itemid = 0 then break end
else 
...
end
end
you want to do this in lua, but fyi it can be up to 10 times slower and consume a lot more CPU cycles than the source function method
 
Back
Top