Need help with Voting for maps

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I need help calculating Votes
  2. What is the issue? Include screenshots / videos if possible!
    I dont how to calculate, so i made this post.
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I want to learn myself without watch tutorials. also i tried using .Touched and having the player have an boolean called ‘Voted’ whenever touched is obviously touched the player’s boolean is set to true, and adds one vote, but it doesnt let players switch between votes if they changed their minds or something else. and using Greater then, but that is too much work and i was looking for an automatic solution, since my voting system has three maps displayed at once
1 Like

What I did for my game was:

  • Make a table with all of the maps available for voting in this order: [1] = {Map=MapInstance;Votes=0}
  • Use a custom table.sort function to sort it based on how many votes it has
  • Pick the first map in the table as the selected map.
1 Like

Ill try that out, will tell you if it works out!

Alright, let me know if you need more help implementing it.

still dunno how to let players switch their votes

You could store the votes as tables of player instead, then when a player switches the vote, move their name to a different map.

(this would require modification of the sorter to get the length of the table instead)

Thanks it worked!!! Marked it as the solution!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.