![]() ![]() Here’s how that would look: local PlayersArray = game:GetService("Players"):GetPlayers() -This will return all the current players in an array.įor _, Player in pairs(PlayersArray) do -The player variable is the player object This method will return an array of players which you can iterate through using an iterative loop. If you’d like to iterate through all current players and execute something, you could use the :GetPlayers() method of Players. It also comes with a variable which is the new Character model. CharacterAdded event of the Player variable, which fires every time the players character is added. game:GetService("Players").PlayerAdded:Connect(function(Player) -Player is equal to the new player instance created This event fires when someone joins the game. This event passes an argument which is equal to the new player. There are many ways to handle something like this, and Roblox provides a variety of different methods.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |