Help with voting system!

Hi, I am making a map voting system, and I want to find out what map the highest number is. However, I have no clue on how to do it. Can someone help? Here is my current script:

local cons = tonumber(workspace.Lobby.Construction.SurfaceGui.TextLabel.Text)
local city = tonumber(workspace.Lobby.Construction.SurfaceGui.TextLabel.Text)
local chosen = "nil"
local numberTable = {city,cons}

for i, v in pairs(numberTable) do
		local number = v
		if number > highestnumber then
			highestnumber = number
		end
	end
	
	local ChosenMap = highestnumber

	task.wait(0.3)

	Status.Value = ChosenMap.Name.. " has been chosen!"

	task.wait(2)

	Status.Value = "Game starting!"

There are a lot of misunderstandings in this code. Can you describe how you want the voting system to work piece by piece? Explain things like how the user casts their vote, how the vote should be started and ended, and how your maps are organized in your game.

Alright.

VOTING SYSTEM:

  1. There are 3 vote pads/map each labeled “0” as default vote.
  2. Player can cast a vote to pick whatever map they want.
  3. If the player decides to change their mind, the previous vote they casted will disappear and will reappear in the new vote pad.
  4. The voted map gets loaded into the game.
  5. Game ends and voting begins again (steps 1-5 repeat).

The maps are in a folder. The folder is called “Maps” and is in ServerStorage. The maps itself are models. When the chosen map is called, the map goes into workspace.

I would recommend breaking you solution into these functions:
StartVote(), which resets the vote counts and selects the 3 maps that can be chosen from, and sets up any GUIs needed for the vote.
CastVote(playerName, choiceNumber), which tries to set that given player’s vote to their choice, either 1, 2, or 3. This can be called from a vote pad Touched event or from a RemoteEvent if using a GUI.
TotalVote(), which counts the votes and returns 1, 2, or 3, based on which map choice has won the vote.
LoadMap(mapChoiceNumber), which looks up the map model from the choice number, originally set by StartVote(), and loads it into the game.

This will get you organized. Put comments in theses functions explaining what they do before you start writing inside each one.