I am trying to make a Map system, what works, but it is too boring!
ExampleTable = {"Map1", "Map2", "Map3", "Example"}
I am trying to make a Map system, what works, but it is too boring!
ExampleTable = {"Map1", "Map2", "Map3", "Example"}
Lua doesn't have shuffle function
Here's a quick and not so bad method to shuffle tables:
function shuffle(tbl)
for i = #tbl, 2, -1 do
local j = math.random(i)
tbl[i], tbl[j] = tbl[j], tbl[i]
end
return tbl
end
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
This works thanks!
This works thanks!