Jump to content

help


(s)ection

Recommended Posts

  
function table.random ( theTable ) 
return theTable[math.random ( #theTable )] 
end 
  
function getMaps() 
local resources = getResources() 
local tablemaps = {} 
for i,map in ipairs(resources) do 
if getResourceInfo(map,"type") == "map" and getResourceState(map) == "loaded" then 
table.insert(tablemaps,map) 
end 
end 
return tablemaps 
end 
  
function startRandomMap() 
local maprandom = table.random(getMaps()) 
startResource(maprandom) 
end 
  

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...