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

How do I detect if someone leaves the game so I can change a value?

Hey,

I've got a leaderboard and at the start of the game, each player may pick a nation, until there, I've got it sorted out, what I want to know is how to detect if someone leaves so I can make that nation available to pick again.

Thanks!

1 answer

Works if the player leaves or is kicked. I don't think roblox has any event for if the player suddenly disconnects.

game.Players.PlayerRemoving:connect(function(ply)
	--Add Nation
end)

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