Attempt to Index Nil

I’m working on a shop system, and for some reason, even though the print statement on line 156 prints out the ClassName, right after, it says it attempted to index nil with “ClassName.”

I don’t see how this makes since, because it prints it out, and there should be nothing changing the value in between the print and the error.

I put in a screenshot rather than code format so you could see where the lines where.

Any help much appreciated, Thanks!

1 Like

image

Remove the local thing from this line

2 Likes

I think this is because the second case of the if statement on line 131 isn’t actually overwriting the variable TypeFolder. Try removing the local in front of the declaration.

1 Like

Thanks, in my haste of copying that line from elsewhere I forgot to remove the local :skull:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.