Im not sure why.. Im stumped.
local ServerStorageMaps = game.Lighting:WaitForChild("ServerMaps") local ServerMaps = ServerStorageMaps print(ServerMaps) -- How the heck is this a userdata?!?!?! NewServerMap = ServerMaps[math.random(1,#ServerMaps)]:Clone() NewServerMap.Parent = MapModel
Error :
15:52:17.933 - Workspace.Main-Script:232: attempt to get length of local 'ServerMaps' (a userdata value) 15:52:17.934 - Stack Begin 15:52:17.935 - Script 'Workspace.Main-Script', Line 232 15:52:17.936 - Stack End
Um.. I have no idea.
It looks like you're trying to get a random child. ServerMaps is currently pointing to an object, it isn't pointing to a table with the children.
local ServerMaps = ServerStorageMaps:GetChildren()
should fix it.