I've seen this before and wasn't able to replicate the problem however i think i now know what it is. You need to have the xp/item tracking interface thing enabled (When you receive xp an interface appears at the top of the screen showing how much xp you've gained and how many of the items you've made out of the total so far)
Where could I find this interface when playing on Oldschool if you don't mind me asking? Not sure if I am being an idiot haha. I set out everything correctly and run the script but each inventory it repeats the problem I mentioned before about 3 times an inventory!