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 make a script continue if a specific player leaves the game?

Okay, so I just need it to where it checks to see if the 'Owner' (string value with a players name) has left the game. This is what I tried:

if game.Players.PlayerRemoving and game.Players.PlayerRemoving.Name == script.Parent.Owner.Value then

1 answer

Yes you can check, you were close. You have to say:

game.Players.PlayerRemoving:connect(player) --The Player
	if player.Name==script.Parent.Owner.Value then
		--run code
	end
end)

2 comments

0

W001: Unknown Global 'player'. Can you fix that?

0

According to the wiki that shouldn't have resulted in that error. Since player is in the connection line. It needs to be in a regular script not a local script. Make sure.

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