How do i add the respawn script?

If you search fore "Respawn" within the "Core Content" tab of the editor you may be able to find a respawn script. You could also check the "Community Content" page in the editor. I would suggest that you experiment with the Respawn() function of player objects as it is fairly easy to use.

(You will need to do a little searching on this page to find the respawn function)
Respawn Function Documentation

It's an item in core content that you just drag into the hierarchy. It'll let you set respawn times and locations.

Respawn Settings is a Setting Object found under Core content.
Adding this obect to the hierarchy provides additional parameters :

Respawn Mode : Specifies the pattern in which players respawn.

  • None : Player does not respawn automatically.
  • In Place : Respawns the player at the same location and rotation as when they died.
  • Round Robin : Respawns the player in a repeating sequential pattern respecting the hierarchy order.
  • At Closest Point : Respawns the player at the spawn point closest to the location the player died.
  • Farthest From Other Players : Respawns the player at the spawn point farthest from any other player.
  • Farthest From Enemy : Respawns the player at the spawn point farthest from an enemy player.
  • Random Spawn Point : Respawns the player at a random spawn point.

Respawn Delay : in seconds

Z_level : If the player's z position, at any point in time, is below this value then we will start to respawn them.

Kill : If set to true, player will die before we respawn them.