The following code is supposed to select 3 unique maps. I get the following error: bad argument #2 (interval is empty)
local maps = game.ServerStorage.Maps:GetChildren()
local tempmaps = maps
local pad1Map
local pad2Map
local pad3Map
function updateMapViews()
local first = math.random(1, #tempmaps) --select a map index from tempmaps
pad1Map = tempmaps[first] --store the map
table.remove(tempmaps, first) --remove it from the tempmaps table (so that the next maps selected are unique)
local second = math.random(1, #tempmaps) --ERROR HERE
pad2Map = tempmaps[second]
table.remove(tempmaps, second)
local third = math.random(1, #tempmaps)
pad3Map = tempmaps[third]
table.remove(tempmaps, third)
tempmaps = maps
end

1 comment
you dont have any maps lol, that's why it's spitting the error.