So I'm trying to make a basic map cache that after it is selected, it would take the last map from the cache and put it back in the pool and then take the selected map and put it in the cache. However, my method doesn't take the last map from the cache, so the game works until it runs out of maps. Here's the script:
local currentMap = MapsToChoose[math.random(#MapsToChoose)]
local workspace_map = game.ServerStorage.Maps[currentMap]:Clone()
local outside_map = game.ServerStorage.Maps[currentMap]
local outcache = game.ServerStorage.OutMaps
workspace_map.Parent = game.Workspace.CurrentMap
outcache:GetChildren().Parent = game.ServerStorage.Maps
outside_map.Parent = game.ServerStorage.OutMaps

3 comments
:GetChilden() returns a table value, you need to make for i,v in pairs(outcache:GetChildren()) do loop and change all of the object's parent, unless you only have one map in the outcache
Do not assume a model's gender.
lmao good one, deserves an upvote