PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience

How to Turn of Auto-Loading and Simulate Character Respawn

How to Turn of Auto-Loading and Simulate Character Respawn

Oct 01 2018, 1:39 AM PST

This script turns off auto-loading and simulates character respawning.

local respawnDelay = 5

game.Players.CharacterAutoLoads = false

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		-- find the humanoid, and detect when it dies
		local humanoid = character:FindFirstChild("Humanoid")
		if humanoid then
			humanoid.Died:Connect(function()
				wait(respawnDelay)
				player:LoadCharacter()
			end)
		end
	end)
	player:LoadCharacter() -- load the character for the first time
end)