NUI CALLBACK vrp_inventory

Hello Guys.

I need help with my inventory script, when opening it, keeps “loading” and in F8 the following message appears:

NUI CALLBACK on client side:

CODE vRPN.Mochila()

function vRPN.Mochila()
	local source = source
	local user_id = vRP.getUserId(source)
	local data = vRP.getUserDataTable(user_id)
	local inventario = {}
	local peso = vRP.getInventoryWeight(user_id)
	local maxpeso = vRP.getInventoryMaxWeight(user_id)
	if data and data.inventory then
		for k,v in pairs(data.inventory) do
			if vRP.itemBodyList(k) then
				table.insert(inventario,{ amount = parseInt(v.amount), name = vRP.itemNameList(k), index = vRP.itemIndexList(k), key = k, type = vRP.itemTypeList(k), peso = vRP.getItemWeight(k) })
			end
		end
		return inventario,peso,maxpeso
	end
end

Inventory on FiveM:

Can you help me with this problem?

Hello, i know im late but ill help maybe someone has the same problem so the problem is that from callback you get 2 things data and cb
you can use the data to send data and the cb is the callback which you send to javascript to know all works fine
You should first do a script that gets the item and give them through a nuimessage in javascript