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

How do you make a script that detects a guest?[ANSWERED]

I'm not kicking the guest when a guest joins a game, i just want to know. pls answer m8.

3 comments

0

THX :D

0

If I helped you, accept my answer

0

how?

1 answer

A Guest's userId is equal to -1, which no other player would have. An example script of detecting their userId.

game.Players.PlayerAdded:connect(function(player)
	if player.userId == -1 then
		print(player.Name.." is a guest!")
	end
end)

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