Looking for a way to drop all items when bag is dropped?

its just the same as the Screen Shot above, Just with a for each loop and drop item function… Been playing around with it but nothing is working

I just need to make a function to drop all items from my inventory including stacked amounts,