WaitForChild called on an Instance that is not in a DataModel.
local spawnsmodel = newmap:WaitForChild("Spawns")
It seems to not know what Spawns is. This is based of the Mad Bloxxer Vids, and my game was working but today when I go to play it has this. Anyone help.
Is newmap an object or a function? If it's a function, you'd have to make the function return the map name, and set that return as a variable. Like this:
function getNewMap() for i, map in pairs(game.ServerStorage:children()) do local mapName = map.Name map.Name = i local newMap = game.ServerStorage:FindFirstChild(math.random(1,5) --change 5 to how many maps there are newMap.Name = mapName return newMap.Name end end local gameMap = game.ServerStorage:WaitForChild(getNewMap()) if gameMap then local spawns = gameMap:WaitForChild("Spawns") end
This is just something I thought up. IT might not work.