I really don't know how to do this. All I know is that you gotta get the player... and that's it.
There's actually a Property in the Player that you can use to get it. Just use a script to get the player, then use this line of code:
PlayerID=Player.userId
If you don't know how to get the player, it can be done easily from a LocalScript using LocalPlayer, like this:
Player=game.Players.LocalPlayer PlayerID=Player.userId
Also, from a server script, you could use a PlayerAdded function like this:
game.Players.PlayerAdded:connect(function(Player) PlayerID=Player.userId end
There you go. I believe that should sum it up for you. If you have any further problems/questions, please leave a comment below. Hope I helped :P
Hi. I'm on mobile if it's confusing.
game.Players.PlayerAdded:connect(function(player) --When a player joins they create this function called 'player' print("User ID: " ..player.userId) --We indicated the userId with '.userId' inside 'player'. end)
Let me know if this helped:)