PcoWSkbVqDnWTu_dm2ix
Collapse Sidebar

CharacterAutoLoads

Players

bool

The CharacterAutoLoads Players property indicates whether Characters will respawn automatically. The default value is true.

If this property is disabled (false), players Characters will not spawn until the Player/LoadCharacter function is called for each Player - including when players join the game.

This can be useful in games where players have finite lives, such as competitive games in which players do not respawn until a game round ends.


Code Samples


This example demonstrates one possible usage of the Players/CharacterAutoLoads property.

The example below respawns all players in the game, if dead, once every 10 seconds. This means that players who die 1 second after all players respawn must wait 9 seconds until the script loads all Player/Character again.

First, this script removes a player’s character when they die and the Humanoid/Died function fires. This is done so that the respawn loop that executes every 10 seconds reloads that player when it does not find the player’s character in the Workspace.

To work as expected, this example should be run within a Script.