Map voting question

how would you make it so people can vote on, for example, four maps?

in-game?
it would just be buttons that increment counters. and counters track properties. and the greatest property’s corresponding map is chosen.

You can make a button with player scope that increments a counter (and deactivates the other buttons)

Thats what I usually do

1 Like

in game yes
wait but how would it automatically select which map?

you would check for which property is greatest and then depending on the property name, it would choose the map. broadcasting channels that are received on teleporters via blocks

Hmm. I would say pair a voting system with a teleporter system.
I’m not quite sure how it would work, but just maybe…

explain more pls… I’m not following well

As OOF said have player scoped buttons that deactivate when pressed. Have a counter for each button [button pressed → increment counter]. Now, get a number, global scoped property for each counter named “[Map Name]-Votes”. Make sure the counters update their corresponding property. Then when time is up, or if you used a player counter (when any button is pressed increment a counter updating the TotalVotes property. get a checker to see if TotalVotes = PlayerCount property or whatever it’s called) deactivate all buttons and trigger a trigger. In this trigger – make sure there isn’t trigger by player collision, create a block. Now in the block created, have these blocks:
Set varMap to “NaN”;
Set varVotes to 0;
if (get property “[Map1 Name]-Votes” > varVotes) {
do set varVotes to get property “[Map1 Name]-Votes”;
---- set varMap to “[the name of Map1]”;
} else if (get property “[Map2 Name]-Votes” > varVotes) {
do set varVotes to get property “[Map2 Name]-Votes”;
---- set varMap to “[the name of Map2]”;
} else if (get property “[Map3 Name]-Votes” > varVotes) {
do set varVotes to get property “[Map3 Name]-Votes”;
---- set varMap to “[the name of Map3]”;
} else if (get property “[Map4 Name]-Votes” > varVotes) {
do set varVotes to get property “[Map4 Name]-Votes”;
---- set varMap to “[the name of Map4]”;
} else {
set varRandom to random integer 1 to 4;
if (varRandom = 1) {
set varMap to “[map 1 name]”;
} else if (varRandom = 2) {
set varMap to “[map 2 name]”;
} else if (varRandom = 3) {
set varMap to “[map 3 name]”;
} else {
set varMap to “[map 4 name]”;
}
}
broadcast on channel, create text with, varMap;


a bit long i know. anyways, the varMap channel will be received on 4 different relays (all players) which are connected to 4 different teleporters.

4 Likes

This is your solution, @Kormorant.

2 Likes

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