I got this error not knowing what its about..
21:31:20.659 - ServerScriptService.MainScript:71: attempt to get length of local 'GameMaps' (a userdata value)
I got this error not knowing what its about..
21:31:20.659 - ServerScriptService.MainScript:71: attempt to get length of local 'GameMaps' (a userdata value)
An error that states anything concerning the message: attempt to get length of, implies you've used the # operator, or string.len function of the string library on a value that isn't a string (or an array, in the case of using the # operator).
As the error message says, somewhere in your script you've attempted to get the length of a userdata value, which the computer cannot interpret.
Solution
Now your question is very vague, so I'm not 100% sure this is your problem. But if you were trying to get the number of how many children are in an object, you can use the GetChildren method on whatever instance you're working with, accordingly with the # operator which will return the amount of elements in your array. Here's an example:
print(#workspace:GetChildren()) -- prints the amount children in the workspace.
I'm not going to cover all about how functions, methods, arrays, ect work in this answer, but if you have any questions about them I'd be happy to help.
This discussion is preserved as it was. New answers, comments, and votes are closed.