local cfgItems = {{18423, 1}, {2345, 1}, {6570, 1}, {6570, 1}, {6570, 1}}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item:getUniqueId(43344) and player:getStorageValue(43344) == 1 then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You already got your reward.")
    elseif player:getStorageValue(43344) <= 2 then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Here are you reward! (:")
         
        local bag = player:addItem(1990) -- Bag id
        for i = 1, #cfgItems do
            bag:addItem(cfgItems[i][1], cfgItems[i][2])
        end
        player:setStorageValue(43344, 1)
    else
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Something went wrong.")
       end
end