setAutoSpawn

About

This export allows you to change the auto-spawning flag.

When this is enabled, players will be automatically spawned upon joining the server at a random spawnpoint. After dying, they will also be respawned after 2 seconds. To instantly and forcefully respawn the player without the cooldown, use forceRespawn.

To determine which spawn point to use in auto-spawning, use setAutoSpawnCallback.

If auto-spawning is disabled, you have to manually call spawnPlayer.

Name

setAutoSpawn

Parameters

bool enabled

Required Arguments

  • enabled Whether to enable or disable auto-spawning.
Lua Example:
exports.spawnmanager:setAutoSpawn(true)
Last modified May 10, 2020: Improve wording in setAutoSpawn (d788b36)