Deathrun maps download only when voted for?

ive seen on some deathrun servers that the maps only download once they are voted for ingame and i was wondering how i could do that so that it doesnt have to download all the maps on first join?

If you’re using WorkshopDL, use game.GetMap with if statements. If FastDL, it will do it automatically

im not sure how. do you mind explaining to me? im using WorkshopDL and i have all maps workshop ids loaded into my workshop.lua file



// Taken from old wiki.garrysmod.org example!

--This is a list of your server's maps which are available through the workshop
--Each one uses the map file's name and the workshop ID
maplist = {}
maplist["ttt_community_bowling_v5a"] = "131667838"
maplist["ttt_westwood_v4"] = "104520719"
maplist["ttt_mc_skyislands"] = "106498411"
--add more maps here


local map = game.GetMap() -- Get's the current map name
local workshopid = maplist[map] 
-- Finds the workshop ID for the current map name from the table above

if(workshopid != nil)then
	--If the map is in the table above, add it through workshop
	print("[WORKSHOP] Setting up maps. " ..map.. " workshop ID: " ..workshopid)
	resource.AddWorkshop(workshopid)
else
	--If not, then hope the server has FastDL or the client has the map
	print("[WORKSHOP] Not available for current map. Using FastDL instead hopefully...")
end


Had it saved on my computer