• 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 [tfs 0.4] Copy item

Blade33711

Member
Joined
Aug 6, 2012
Messages
133
Solutions
1
Reaction score
5
Location
Poland
How to copy item from position to position?
I tried this way, but it does not work.
Lua:
local pos = {x = 1083, y = 1014, z = 7, stackpos=255}
doCreateItem((getThingfromPos(pos).uid), 1, {x = 1084, y = 1014, z = 7})

Or:
Lua:
doCreateItem(getTileItemById(pos, (getThingfromPos(pos).uid)), 1, {x = 1084, y = 1014, z = 7})

Error:
Lua:
(luaDoCreateItem) Item not found
 
Solution
Code:
doCreateItem(itemid, type/count, pos)
On line 2, your attempting to get the 'uid' instead of 'itemid'
Try with and without the stackpos, I'm fairly certain you don't need it though.
Lua:
-- local pos = {x = 1083, y = 1014, z = 7, stackpos = 255}
local pos = {x = 1083, y = 1014, z = 7}
doCreateItem((getThingfromPos(pos).itemid), 1, {x = 1084, y = 1014, z = 7})
Code:
doCreateItem(itemid, type/count, pos)
On line 2, your attempting to get the 'uid' instead of 'itemid'
Try with and without the stackpos, I'm fairly certain you don't need it though.
Lua:
-- local pos = {x = 1083, y = 1014, z = 7, stackpos = 255}
local pos = {x = 1083, y = 1014, z = 7}
doCreateItem((getThingfromPos(pos).itemid), 1, {x = 1084, y = 1014, z = 7})
 
Solution
Ty a lot! Without the stackpos, it does not work. :p
heh. Oh well. xD
I haven't worked with getThingFromPos in awhile. :p
I'm always like.. "I think/assume this.. -> insert trial and error for 40 minutes <-"
 
Back
Top