![]() ![]() However, if you want only 1 other player to be the runner, follow the instructions below: local runner = players If you want to have every single other player be the runner, then you can use the players list we made to iterate over every single other player. table.remove(players, table.find(players, catcher)) Now, we remove the catcher from the list we created of the players. We’d be getting the 3rd player from that list ( players). Now, let’s imagine the number 3 is picked. ![]() It would be like writing math.random(1, 5). For example, let’s imagine the number of players in the game is 5. To select which element we want, we’re using math.random(1, #players), which is selecting a random number from 1 to the number of players we currently have in the game. So, it’s getting an element from that table using the square brackets. What the line of code above is doing is the following: the ‘players’ variable is a table. ![]() Next, we have to select the first player (the catcher) from that list. local players = game.Players:GetPlayers() Then, you will give them each of their own abilities.įirst, get the list of players in the game. Essentially what you want to do is get 2 random players from inside the server and select them to fulfill each role. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |