Animescapetower

Untitled

Feb 16th, 2018
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. local respawnDelay = 5
  2.  
  3. game.Players.CharacterAutoLoads = false
  4.  
  5. game.Players.PlayerAdded:connect(function(player)
  6. player.CharacterAdded:connect(function(character)
  7. -- find the humanoid, and detect when it dies
  8. local humanoid = character:FindFirstChild("Humanoid")
  9. if humanoid then
  10. humanoid.Died:connect(function()
  11. wait(respawnDelay)
  12. player:LoadCharacter()
  13. end)
  14. end
  15. end)
  16. player:LoadCharacter() -- load the character for the first time
  17. end)
Add Comment
Please, Sign In to add comment