Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Player auto loads?

Is there a way to stop players from auto magically responding once their health hits 0 is this possible?

1 answer

Yes, look at CharacterAutoLoads

Example code from the page:

local respawnTime = 5
 
local Players = Game:GetService("Players")
Players.CharacterAutoLoads = false
 
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()
				-- delay, then respawn the character
				wait(respawnTime)
				Player:LoadCharacter()
			end)
		end
	end)
 
	Player:LoadCharacter() -- load the character for the first time
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.