• 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 script don't work

Shiko Erye

LUA - Scripter
Joined
Dec 7, 2010
Messages
106
Reaction score
12
Lua:
function doAddBall(cid)
local box = getPlayerSlotItem(cid, 5).uid
doAddContainerItem(box, 2220)
end
Why this don't work???
 
Try
Lua:
config = 
{
	slotId = CONST_SLOT_RIGHT,
	itemId = 2220,
	count = 1
}

function doPlayerAddBall(cid)
	local slot = getPlayerSlotItem(cid, config.slotId)
	if (slot.uid > 0) then
		return doAddContainerItem(slot.uid, config.itemId, config.count)
	end
	return false
end
 
@Ralcoral: don't work
@andypsylon:
in slot 3 (value: backpack) for common item
in slot 5 (value: backpack) for rare item after complete quest (can't move)
i want add Item to slot 5:D

what i must do?
 
Code:
<item id="1988" article="a" name="Box">
	<attribute key="weight" value="0" />
	<attribute key="containerSize" value="12" />
	<attribute key="slotType" value="backpack" />
</item>

that is item in slot 5:S
 
Try this, and send me message from console (or gui)
Lua:
config = 
{
	slotId = CONST_SLOT_RIGHT,
	itemId = 2220,
	count = 1
}
 
function doPlayerAddBall(cid)
	local slot = getPlayerSlotItem(cid, config.slotId)
	if (slot.uid > 0) then
		print(slot.uid, slot.itemid, getContainerSize(stot.uid))
		return doAddContainerItem(slot.uid, config.itemId, config.count)
	end
	return false
end
 
Back
Top