[HELP] Get Item bought

Hi,

I am trying to do a simple menu Store to buy some items but I am getting problems to buy a item.
My store menu displays , and I can select the item but When I press enter it doesn´t do anything.
I am sure the fail is not Enter Key because I use the same gui for other script and it works.

function repairKit()
    TriggerEvent('es:getPlayerFromId', source, function(user)
        if(user.money > 500) then
            local repaircount = 0
            TriggerEvent("player:getQuantity", 7, function(data) -- GET QUANTITY ON INVENTORY
                repaircount = data.count
	        end)
            if repaircount < 2 then
	            TriggerEvent("player:receiveItem", 7, 1) -- ("player:receiveItem", 1, 1) = ADD ITEM , ID1 ( object ), AND "+1"
	            TriggerClientEvent("es_freeroam:notify", source, "CHAR_AMMUNATION", 1, "BADULAKE", false, "thanks.")
			    user:removeMoney(500)
	        else
	        drawNotification("~r~Not enough space!")
	        end
	    else
	        drawNotification("~r~Not enough cash!")
	    end
	end)
end

function menuTiendas()
    MenuTitle = "Productos"
    ClearMenu()
    Menu.addButton("Repair Kit", "repairKit", arg)
    Menu.addButton("Armor", "armor", arg)
end

Cheers,

Edit: not erros in F8 and Console :S

Item created in the DB ? Maybe ? Cause inventory is all with items created in the DB.

The item is created into DB , it´s weird because should have some error in Debug Console or displays some drawNotification but It is not.

Hope you’ll find a solution. Interested in that kind of stuff i you release it :slight_smile: (Hope so :))

I have done a short advanced : I can buy a item. My problem is still being to set a item maximum…

1 Like

What Inventory script did you use ? VDK_Inventory ?

Yes, I use vdk inventory

This modifications didn’t help in this case right ? :

Maybe only work on recolt and not on buying, dunno, try to help you as much as I can :slight_smile: