I want to make a random map selector, but it seems that the selector is picking a map and not continuing, I want it to pick a map and then keep repeating
local function changed()
if game.Workspace.time.Value == 0 then
local e = math.random(1,2)
if e == 1 then
choice = map2
end
if e == 2 then
choice = map1
end
game.Workspace.time.Value = 30
choice:Remove()
wait(3)
choice.Parent = game.Workspace
end
end
sorry for gross code I was tired when I made this lol, (and im decently new to scripting) the event is fired every second

2 comments
Forgot to mention that :Remove is deprecated
the choice:remove part was the cleanup function, the problem was that I guess I ran the selector too early meaning that it would pick a map, remove the map, then try to set it's workspace like you said, so thanks for responding!