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

How to AddItem to specific slot?

If you wanna only add new item to SLOT x, you can use the function doPlayerAddItem(cid, itemid[, count/subtype = 1[, canDropOnMap = true[, slot = 0]]]).
Try this:
Lua:
doPlayerAddItem(cid, 2160, 1, true, SLOT_LEFT)

I'm not sure about that. =S
 
Doesn't seem to be working, says player is not found(?).

- - - Updated - - -

Also tried this, still no success.

doPlayerAddItem(cid, 2377, count == 1, canDropOnMap == true, subtype == 1, CONST_SLOT_LEFT)
 
Parameters are like this:
doPlayerAddItem(cid, itemid[, count = 1[, canDropOnMap = true[, subtype = 1[, slot = 0]]]])

So what I posted: doPlayerAddItem(cid, 2160, 1, false, 1, SLOT_LEFT)
Should work, I use it sometimes and it works like it should.
 
Lua:
doPlayerAddItem(cid, 2377, 1, true, 1, SLOT_LEFT)

The function requires 5 parameters in order to use the slot parameter.
 
It's for 8.54, don't know if that matters at all, but it doesn't work, lemme show you.

- - - Updated - - -

[24/01/2013 21:36:59] [Error - Action Interface]
[24/01/2013 21:36:59] data/actions/scripts/tools/picking.lua:eek:nUse
[24/01/2013 21:36:59] Description:
[24/01/2013 21:36:59] (luaDoPlayerAddItem) Player not found

doPlayerAddItem(cid, 2377, 1, true, 1, CONST_SLOT_LEFT)

or

doPlayerAddItem(cid, 2377, 1, true, 1, SLOT_LEFT)

By the way, I have an issue with more stuff in this script:

doPlayerAddItem(cid, 2377, 1, true, 1, SLOT_LEFT)
doPlayerAddItem(cid, 2463, 1)
doPlayerAddItem(cid, 9775, 1)
doPlayerAddItem(cid, 1988, 1)
local pos = {x=91, y=118, z=7}
local tmp = getThingFromPos(pos)

doRemoveCreature(tmp.uid)
end
end

It does add all other items, however, it doesn't remove thing from pos.

[24/01/2013 21:38:18] [Error - Action Interface]
[24/01/2013 21:38:18] data/actions/scripts/tools/picking.lua:eek:nUse
[24/01/2013 21:38:18] Description:
[24/01/2013 21:38:18] (luaDoRemoveCreature) Creature not found

It's definitely there, it's npc.
 
Last edited:
Probably that parameter for slot did not exist in 8.54.
Add a stackpos to the position.
 
Back
Top