The script I supposed to chose a random map and spawn it in. But I got a few errors.
"Attempt to index nil with 'Name' "
Then I changed it a little and got
Attempt to index nil with 'Parent' "
Script:
local ServerStorage = game:GetService("ServerStorage") local MapsFolder = ServerStorage:WaitForChild("Maps") while true do status.Value = "Intermission" wait(10) local Maps = MapsFolder:GetChildren() local randomMap = math.random(1,#Maps) Status.Value = "Map chosen: "..randomMap.Name randomMap.Parent = game.Workspace end
It is because randomMap value is a random number between 1 to how much children inside maps, BUT number does not have a name, or a parent. It's a string, not an instance. So what are you gonna do is replace line 11 to:
local randomMap = Maps[math.Random(1,#Maps)]