ABSOLUTE LIFE SAVER. See I was running with something similar:

if xPlayer.getInventoryItem('casinochips') >= amount then
        xPlayer.removeInventoryItem('casinochips', amount) 
       return true
    else
       return false
    end    
end

But because I forgot .count behind the (casinochips) it would return SCRIPT ERROR: Attempt to compare number with table. I’m such an idiot. Thanks mate <3