For example I'm making a starter menu and would like to have a page where it says "profile" and would like to automatically have your roblox USER ID shown and your "Account" age but I'm not totally sure how to do it.. like I've tried everything and nothing is working
✓ ANSWER ACCEPTED
Is there a way to automatically get someones roblox user id?
3 answers
✓ Accepted answer
You can get a players properties(such as their account age and userid by doing something like this)
local plr = game.Players.LocalPlayer
local UserID = plr.UserId ------ Then you can change that to anything like AccountAge, MembershipType and Every property in player
Check the player properties, what you're looking is there.
local Player = game.Players.LocalPlayer
local AccAge = Player.AccountAge
local UserId = Player.UserId
https://developer.roblox.com/en-us/api-reference/class/Player
1 comment
0
Wdym? Sorry I'm very new to scripting and likeee yea
The easiest way to do this is by using GetUserIdFromNameAsync
Here: https://developer.roblox.com/en-us/api-reference/function/Players/GetUserIdFromNameAsync
Example code:
game.Players.PlayerAdded:Connect(function(p) -- PlayerAdded event
local UserId = game.Players:GetUserIdFromNameAsync(p.Name) -- How to use it; must be a string and a valid username.
print(UserId) -- Prints their userid
end) -- Ends this event
2 comments
0
I'm so confused tbh I wish it was much simpler
0
It's actually really simple though. One line: "game.Players:GetUserIdFromNameAsync("Pupppy44")", and it returns 131470756, my userid.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Do I put this in a text label?