This event probably runs every tick, meaning that every tick it will add (the) 17 instances to count.
You probably need to add more conditions to limit its execution, or pay more attention to where it is placed (for example, as subevent of a start of layout event, it will only run once on the very beginning of the layout.)
Be sure to read over and over again how events work.
When in doubt, look at your code and try to "translate" it the way C2 will read it.
Event 4, every tick it will loop through each instances of InventorySlot and add 1 to the variable count.