Skip to content
Search/
CyberMax › Answers

Roblox map voting: let players pick the next map

Updated 2026-11-16 · Roblox and game developers · by CyberMax

Short answer

During intermission, pick 3 random maps from ServerStorage, publish them to clients, accept one vote per player through a RemoteEvent (a new vote replaces the old one), and when the timer ends, count votes, break ties at random and clone the winning map into workspace.

Copy-paste code

Server: one vote round

local maps = game.ServerStorage.Maps:GetChildren()
local Vote = game.ReplicatedStorage.MapVote -- RemoteEvent
local rng = Random.new()

local function runVote(seconds)
	local pool = table.clone(maps)
	local options = {}
	for i = 1, math.min(3, #pool) do
		table.insert(options, table.remove(pool, rng:NextInteger(1, #pool)).Name)
	end
	local votes = {} -- [player] = map name
	local conn = Vote.OnServerEvent:Connect(function(player, choice)
		if table.find(options, choice) then votes[player] = choice end
	end)
	Vote:FireAllClients(options, seconds)
	task.wait(seconds)
	conn:Disconnect()

	local count = {}
	for _, name in options do count[name] = 0 end
	for player, name in votes do if player.Parent then count[name] += 1 end end
	local best, winners = -1, {}
	for _, name in options do
		if count[name] > best then best, winners = count[name], { name }
		elseif count[name] == best then table.insert(winners, name) end
	end
	local chosen = winners[rng:NextInteger(1, #winners)]
	local map = game.ServerStorage.Maps[chosen]:Clone()
	map.Parent = workspace
	return map
end

Good to know

Destroy the previous map before cloning the next one, or rounds will stack maps.

Only count votes from players still in the server (player.Parent).

Roundmoor Round & Match System icon

Roundmoor Round & Match System: Rounds, map votes and teams that never get stuck

from $7

Roundmoor includes the map and mode vote, fair teams, win checks for four modes and the full round loop, tested together.

Secure checkout · 14-day fix-or-refund if it doesn't work as described (terms)

Questions

How do clients vote?

Show the 3 options from Vote.OnClientEvent as buttons; each button calls Vote:FireServer(name).

How do I stop the same map twice in a row?

Remove the last map's name from the pool before picking options.

Free: the Roblox Starter Kit

7 free Luau modules (damage, pets, shop formatting, admin audit log, tycoon guards and more) plus 3 free calculators, then 5 short emails with the scripting fixes we see go wrong most often.

You get one email to confirm first. Then the kit, and 5 short emails over two weeks. One-click unsubscribe in every email; we never share your address.

Related answers

Roblox round system: intermission, round timer and winnersA server loop for round-based games: wait for enough players, intermission countdown, teleport in, round timerHow to raycast in Roblox: a gun script the server checksworkspace:Raycast with RaycastParams for a hitscan gun: the client sends aim, the server checks fire rate and