Problems with int errors

You can't subscript a scalar

Please remember to use code tags when posting code