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

Disconnection Message Upon Dying?

I want the player to be disconnected when they die.

1 answer

✓ Accepted answer

Call the Kick() method of player when the character dies. You can detect when a player dies using the Died event of humanoid.

Example:

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(char)
		char:WaitForChild("Humanoid").Died:Connect(function()
			player:Kick()
		end)
	end)
end)

2 comments

0

can you add a reason?

0

Yes, you can pass a string in as the argument of the function, and it will display on the top red bar that appears when the player is kicked—like so: player:Kick("You have died.")

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