So I basically wrote this where canCarryItem was written
if xPlayer ~= nil then
– Write the code
end
But you will need to make a code to set limit. I tried writing this and it worked:
if xPlayer.getInventoryItem(“weed”).count < 100 then ( For it to give an disclaimer that you can’t pick any more weed)