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 make this piece of code loop all the time instead of once?

game.Players.PlayerAdded:connect(function(player)
	print(player.Name.." ".."has joined")
	repeat wait() until player.Character.Head
	player.Character.Humanoid.Died:connect(function()
		print(player.Name.." ".."has died")
	end)
	
end)

2 answers

game.Players.PlayerAdded:connect(function(player)
	print(player.Name.." ".."has joined")
	player.CharacterAdded:connect(function(char) --fires every time the player respawns.
	print(player.Name.." ".."has spawned")
		char.Humanoid.Died:connect(function()
			print(player.Name.." ".."has died")
		end)
	end)
end)

2 comments

0

thanks, i never knew abou the character added function and that it fires every time a player spawns

0

Same.

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