Does this piece of script can detect new Character and Humanoid?

local PlayerCharacter, Humanoid 

repeat
	PlayerCharacter = Player.Character
until PlayerCharacter

repeat
	Humanoid = PlayerCharacter:FindFirstChildOfClass("Humanoid")
until Humanoid

local OldCharacter = PlayerCharacter

-----------------------------------------------------------------------
Humanoid.Died:Connect(function()
	PlayerCharacter = nil
	repeat
		PlayerCharacter = Player.Character
	until PlayerCharacter and PlayerCharacter ~= OldCharacter
	OldCharacter = PlayerCharacter
	repeat
		Humanoid = PlayerCharacter:FindFirstChildOfClass("Humanoid")
	until Humanoid
end)

Does this piece of script can detect respawned player’s character?

1 Like

Here, this shows how to connect to characteradded.

Link

1 Like