Cornwallis
Member
- Joined
- Jan 3, 2010
- Messages
- 480
- Reaction score
- 16
Hello, I'm trying to send the item to the store inbox. I'm either accessing the store inbox with this script wrong, or something in sources, but i don't know because i don't get any errors. NOTE: i can move items freely to the store inbox( i did this to make sure it wasn't some equip error ), i have it defined as a slot, i have the store inbox item there. here's the code that adds the item:
If it's not this script then i'll find it.
Code:
function onRender(player, offer)
return true
end
function onBuy(player, offer)
local itemType = ItemType(offer:getName())
if itemType:getId() == 0 then
player:sendStoreError(STORE_ERROR_PURCHASE, "Item not found. Please contact an administrator.")
return false
end
local storeBox = Container(player:getSlotItem(CONST_SLOT_STORE_INBOX))
local gameItem = Game.createItem(itemType:getId(), 1)
local storeBoxAddItem = storeBox:addItemEx(gameItem)
if storeBoxAddItem then
return true
end
end