Hi there i' ve got a container with 1 item in it. Is this function supposed to give my character this item? Or just send item's values so i can do something like:
If yes then it doesn't debug but it doesn't work too. I am using a chest so my item is container. When i am trying to do
player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found a ' .. item:getItem(0) .. '.')
or getItem(1) i get error in console. Why? My container(item) has 1 item so it shouldn't debug a text with item:getItem(0) or (1).
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local reward = item:getItem(0)
player:addItem(reward,1)
If yes then it doesn't debug but it doesn't work too. I am using a chest so my item is container. When i am trying to do
player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found a ' .. item:getItem(0) .. '.')
or getItem(1) i get error in console. Why? My container(item) has 1 item so it shouldn't debug a text with item:getItem(0) or (1).