1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
function itemcount(id, itemid)
	local amount, items = 0, {}
	for k, v in ipairs(PLAYERS[id].Inventory) do
		if v == itemid then
			amount = amount + 1
			table.insert(items, k)
		end
	end
	return amount, items
end
1
variable1 = itemcount(id, 1)
P.S. Can someone explain the difference of:
1
2
2
variable = 1 local variable = 1
Get 1 var on return
1 
Offline