Chillstice

changing maps

Sep 9th, 2015
1,349
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.10 KB | None | 0 0
  1. --This is a list of your server's maps which are available through the workshop
  2. --Each one uses the map file's name and the workshop ID
  3. maplist = {}
  4.  
  5. maplist["gm_trainconstruct2"] = "161015436"
  6. maplist["gm_freespace_13"] = "115510325"
  7. maplist["gm_citylimits_day_v1"] = "106750883"
  8. maplist["gm_citylimits_v2"] = "104674256"
  9. maplist["gm_bluehills_test3"] = "243902601"
  10. maplist["gm_excess_islands"] = "115250988"
  11. maplist["gm_bigcity"] = "105982362"
  12. maplist["gm_fork"] = "326332456"
  13. maplist["gm_Lair"] = "104488112"
  14.  
  15.  
  16. --------------------------------------------------
  17.  
  18. local map = game.GetMap() -- Get's the current map name
  19. local workshopid = maplist[map]
  20. -- Finds the workshop ID for the current map name from the table above
  21.  
  22. if( workshopid != nil )then
  23.     --If the map is in the table above, add it through workshop
  24.     print( "[WORKSHOP] Setting up maps. " ..map.. " workshop ID: " ..workshopid )
  25.     resource.AddWorkshop( workshopid )
  26. else
  27.     --If not, ) then hope the server has FastDL or the client has the map
  28.     print( "[WORKSHOP] Not available for current map. Using FastDL instead hopefully..." )
  29. end
Advertisement
Add Comment
Please, Sign In to add comment