Glitch with inventory system

Hi, I am stuck on this for over a hour so I went here.

So I have this inventory but it does not work, I think there is a glitch at the array part but see for yourself: