Player functions
Access Player properties and methods After fetching a player instance, you can access its properties and methods using the dot (.) notation. For example, to get the player's username, use:
Similarly, you can call other methods available in the Player
class, such as:
To set properties, use the same dot notation:
Interact with the PlayerManager The PlayerManager
allows you to interact with multiple players. To get the global instance of the PlayerManager
, use:
Now you can call methods from the PlayerManager
class:
Iterate over all players The GetAllPlayers
function returns a table (Lua's version of an array) containing all players. To iterate over all players and perform actions, use a loop:
Last updated