Hi, I’m attempting to make a voting system ( has gone good so far ), for some reason its picking a map other than the one that’s highest any help with be appreciated!
function intermission.PickWinningVote()
local highestnumber = 0
local temp_table = {}
local game_folder = game:GetService("ServerStorage"):WaitForChild("Games")
for i = 1, 3 do
local map = intermission.mapChoices[i].Votes
print(map.Value)
table.insert(temp_table, map.Value)
end
for index, value in pairs(temp_table) do
warn(value)
highestnumber = math.max(unpack(temp_table))
end
print(highestnumber)
print(intermission.mapChoices[highestnumber].Name)
--game_module.CloneMap(intermission.mapChoices[highestnumber].Name)
end
No errors