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

How can I short respawn time?

So what I am trying to do here is shorten the time between death and respawn. Like, usually when you die it takes 5 seconds to get back up, but how can I shorten that? Once I tried this script in a backpack:

local player = script.Parent.Parent
local char = player.Character
local h = char.Humanoid
h.Died:connect(function()
	wait(0.5)
	player:LoadCharacter()
end)

The problem with that is that they respawn 2 times, one in 0.5 seconds, and one in 5 seconds.

Can someone help?

2 answers

1. While in Studio, set Players' ``CharacterAutoLoads property to false. 2. Then, change the script to this:

game.Players.PlayerAdded:connect(function(p)
	p:LoadCharacter()
	local char = p.Character
	repeat wait() until char
	local human = char:WaitForChild("Humanoid")
	human.Died:connect(function()
		wait(0.5)
		p:LoadCharacter()
	end
end)

1 comment

0

Character is not a child of Player.

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