I’m currently with 12 friends and we want to randomize the team without us choosing or using a wheel so is there Workshop codes that randomize our team?
Yeah its fairly easy using the Move Player To Team action which takes 3 parameters… Player Team & Slot
leaving Slot on -1 just makes it irreverent / automatically handled, so you can ignore that parameter.
for players while you could run a script to move players randomly for awhile that could result in players being shuffled multiple times unnecessarily as well as leaving some players on a team thats full, what you want to do is set a Global Variable to Randomised Array(All Players(Team All)) which will an Array with all the players in the lobby with a random order.
then run a For Global Variable using a second Global Variable as the Index the Start should be 0 & the End should be the Count of(Global Variable.PlayersArray) the Step should be 1.
inside the For Global Variable loop just run a single action Move Player To Team(Value In Array(Global Variable.PlayersArray, Global Variable.Index), If then else(Compare(Global Variable.Index < Divide(Count Of(Global Variable.PlayersArray), 2)), Team 1, Team 2), -1)
for anybody on the correct team already is wont do anything, for anybody on the wrong team as the randomiser chose them to be on, it’ll swap it for them. if the team a player is moved to is full when attempting to move them, it’ll put them in queue for that team until there is an available slot on the team… the If than else statement automatically sets the team depending on which half of the Global Variable.PlayersArray they are stored within the Array.
Sorry about the fact you can’t copy this directly into the workshop or if it sounds confusing… i wrote this all from memory while trying to use the visual respiration of the code instead of the actual code version of the code.
Also if you want to get really fancy you can technically swap teams mid-match with only minor bugs… but that is rather long & somewhat advanced, i’ve done it before… I doubt you want/need to do that however, so i wont go through the lengthy explanation of how to do that (it is rather simple in my opinion tho, i used it for an Effect in my 100 effect Chaos gamemode)