Respawn not working

plr.Character.Humanoid.Died:Connect(function()
		print(plr.Character.Humanoid:GetAttribute("Lives"), "lives")
		plr.Character.Humanoid:SetAttribute("Lives", (plr.Character.Humanoid:GetAttribute("Lives"))-1)
		if plr.Character.Humanoid:GetAttribute("Lives") > -1 then
			repeat task.wait() until plr.Character.PrimaryPart
			wait(.2)
			plr.Character.PrimaryPart.Position = gameSpawn.Position
			speed(plr,250)
		end
	end)

It only respawns once

I need answers, I think humanoid.Died is not working.

When I die it only outputs once then stops

Try this.
ServerScript in ServerScriptService.

local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        local humanoid = character.Humanoid
        humanoid.Died:Connect(function()
            print("Your code here")
        end)
    end)
end)

Also what exactly is this for?

To wait until the character loads

player.CharacterAdded:Wait() waits for the character to load, also you won’t need to wait in the script i gave you because it runs Everytime the character gets loaded in

Just put :WaitForChild like

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        local humanoid = character:WaitForChild("Humanoid")
        humanoid.Died:Connect(function(parameter)
            --  Continue
        end)
    end)
end)

IMPORTANT: This script NEVER work in LocalScript.

I see you’re using Set and GetAttribute on the humanoid of the player, however once the player dies, the humanoid is reset and all of the attributes are removed. I would imagine that trying to get the attribute that doesnt exist, is stalling the script.

This isn’t a properly formatted and a recommended script, you are firing this event each time, the character respawns, this causes a function to pile up each time player dies

You should do this:

game.Players.PlayerAdded:Connect(function(player)
        task.wait(1) until player.Character
        local character = player.Character
        local humanoid = character:WaitForChild("Humanoid")
        humanoid.Died:Connect(function(parameter)
            --  Continue
        end)
end)

Here the event fires when player joins, if they leave the game, you have to break the function to avoid memory leaks, or flooding errors in dev console

Why you using task.wait(1)? Maybe task.wait() is better.

Why spam?

task.wait(1) will wait 1 second even if the character is already loaded. Wouldn’t it be better to use task.wait()?

Maybe because the connection only applies to the current humanoid. After the humanoid dies and is removed from the game the connection disconnects and will not work for new humanoids.
You can use the CharacterAdded event, as shown in another reply, or reset the connection for every time a new humanoid is created.

Will check. Currently I think attributes are the problem.

The issue is now fixed, I combined your solutions. If you would like to know the new code:

plr.CharacterAdded:Connect(function(character)
		local humanoid = character.Humanoid
		if time == "Game" then
			lives -= 1
			if lives >= 0 then
				
				wait(.2)
				plr.Character.PrimaryPart.Position = gameSpawn.Position
				speed(plr,250)
			end
		end
	end)