So i want 8 seconds to respawn and it works only once, then it just stays dead.
local time = 8 game.Players.CharacterAutoLoads = false game.Players.PlayerAdded:connect(function(player) game.Players.CharacterAutoLoads = true repeat wait() until player.Character game.Players.CharacterAutoLoads = false player.Character.Humanoid.Died:connect(function() wait(time) player:LoadCharacter() end) end)
problem ? No errors.
Your problem is that you're only setting up the events for one humanoid, which gets removed the first time you respawn.
To fix this, we'll have to use a CharacterAdded event to run you're function for every character that is loaded.
local respawnTime = 8 game.Players.CharacterAutoLoads = false game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) local humanoid = character:WaitForChild("Humanoid") humanoid.Died:connect(function() wait(respawnTime) player:LoadCharacter() end) end) wait() player:LoadCharacter() end)
NOTE: It's a good habit to effectively tab your code. It will make it much easier to read and spot errors.