Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make a script that will randomly pick 1 or 2 players to be swapped to a different team?

Asked by 7 years ago

I want it to randomly pick one or two players (depending on the number of players in-game) to be on that team but I'm very rusty with scripting as I haven't done it in a while lol

Please help!

1 answer

Log in to vote
0
Answered by 7 years ago

An easier way to do this is set the limit of how many players there can be in a team with strings, for example create 2 Number Values into the player like creating leaderstats.

For more info on leaderstats/leaderboards visit this website;

http://wiki.roblox.com/index.php?title=Leaderboard

After, name the first NumberValue "TeamA" or anything u want. Name second one "TeamB".

Set the Value of the NumerValue to the certain amount of players you want on a team.

Now you want to add a startergui and frame and 2 buttons. 1 will teleport u to TeamA and other will Teleport u to TeamB

add a script that checks that amount of players and checks the number value for example

if --players on TeamA is less then somethingvalue then blah blah blah

more info can be found here:

http://wiki.roblox.com/index.php?title=API:Class/Team/GetPlayers

This site isn't a script request site so I won't be giving you free scripts. We are here to help you learn. Anyway, if this helped ya in a certain way then please accept answer and upvote :D

Ad

Answer this question