Caduceus
Unknown Member
- Joined
- May 10, 2010
- Messages
- 321
- Solutions
- 2
- Reaction score
- 24
I am trying to find a way to define Item in a script that does not have it included in the function. I keep getting "attempt to index local 'item' (a nil value)"
Lua:
elseif offer.type == GameStore.OfferTypes.OFFER_TYPE_MULTI_ITEM then
local inbox = player:getSlotItem(CONST_SLOT_STORE_INBOX)
if inbox and inbox:getEmptySlots() > 0 then
local item = Item(uid) -- this does not work
local multipack = isInArray(offer.thingId, item:getId())
local parcel = inbox:addItem(2596, 1)
local packagename = ''.. offer.count..'x '.. offer.name ..' package.'
if parcel then
parcel:setAttribute(ITEM_ATTRIBUTE_NAME, packagename)
for e = 1,offer.count do
parcel:addItem(multipack, 1)
end
end
else
return addPlayerEvent(sendStoreError, 250, player, GameStore.StoreErrors.STORE_ERROR_NETWORK, "Please make sure you have free slots in your store inbox.")
end
Last edited: