When you posted the line of code above, did you copy/paste from your script or did you retype it?
The only reasons I can think of that would cause that error is if you had mistyped something, or if you had an id where one of goal_min through goal_min6 were not defined for that id.
I don't really understand what goal_min and goal_max are used for, if they are meant to be equal in order to signify the goal is complete, and I don't really want to watch the video to find out. The script comments really don't explain anything about how to use it, I suppose assuming that everyone is going to watch the video.
If the player needs to collect a certain amount of items to complete the quest, can you just stop them from getting more of them?