Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 6 years ago

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

Log in to vote
0
Answered by 6 years ago

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)
Ad

Answer this question