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

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

Asked by 9 years ago

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

0
THX :D TheIronCube 0 — 9y
0
If I helped you, accept my answer Shawnyg 4330 — 9y
0
how? TheIronCube 0 — 9y

1 answer

Log in to vote
0
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
9 years ago

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

Answer this question