I am working on a project and it all depends on me being able to allocate the UserId of the player and check to see if it matches the allowed one. How would I find the UserId from my LocalPlayer? Would it be through game.Players.LocalPlayer.Character? What is the best method for this? Thanks so much!
✓ ANSWER ACCEPTED
How do I find UserId from LocalPlayer [SOLVED]?
2 answers
✓ Accepted answer
Just use the userId property, i.e.
print(game.Players.Player.userId)
If your only purpose is to allow only certain people to join the game, however, why would you not simply use their name?
In every player there are many options to choose from. For this occasion scroll down to userId
--Example-- (IN LOCAL SCRIPT)
print(game.Players.LocalPlayer.userId)
1 comment
0
I figured it out and never saw this so I unfortunately have to say that Percil gave me the answer I needed. I knew about changing it to LocalPlayer and using a LocalScript. Thanks though.
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
IDs are better, because the player can just get a name change to bypass the filter (Spend 1,000 R$).
Not if the name is already taken, so if you wanted specific people to be able to enter no one could take their name. For example, there is absolutely no one else in Roblox named Perci1, nor will there ever be.
@Perci1 he means the player itself changes it, for example, if your doing a currency system, and you use usernames. You don't like your username, change it, but then your currency goes to 0.
dude i know, it's been two years lol