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

Is there any way to get a player's ID just using their name?

Asked by
Minifig77 190
10 years ago

I'm trying to create a machine where you type in someone's username, and then when you step on a plate it'll change your character appearance and respawn you. Originally, I was thinking of making it so you type in someone's user ID and would do the rest, but then I thought that looking up someone's user ID every time you want to change your character appearance would be tedious.

To do what I want the said machine to do, I have to have a way to get someone's player ID by simply inputting their username--even when the person isn't on the game. Is there a way to do this?

0
Remove the "User input" tag. This tag has nothing to do with your question. User#11893 186 — 10y

8 answers

Log in to vote
1
Answered by 10 years ago

You're going to need to use HttpService. Check out this page on user-created ROBLOX APIs, and find one that supports the username->userId conversion. Then, simply utilize it to find the userId.

Ad
Log in to vote
2
Answered by
Bubby4j 231 Moderation Voter
10 years ago

This can be done, but not in pure Lua.

You'll have to use HTTPService which will ask your own website to look it up on the roblox website (because you can't use HTTPService on the roblox website).

There is a list of Roblox Web APIs on the wiki that may be of use.

0
Why was this downvoted? Bubby4j 231 — 10y
Log in to vote
2
Answered by 7 years ago

I know this is an old post, but to all the people who are searching and looking for this in 2016 roblox has implemented a couple functions as follows

local playerName = game.Players:GetNameFromUserIdAsync(21467784);
local playerId = game.Players:GetUserIdFromNameAsync("MrLonely1221");

print(playerName,"-",playerId);

These functions will do exactly as is their name.

0
Hey there, ik this is old. But thanks a ton. wilsonsilva007 373 — 5y
0
Hey there, ik this is old. But thanks a ton. wilsonsilva007 373 — 5y
Log in to vote
0
Answered by
nate890 495 Moderation Voter
10 years ago

You can't get their user ID via. name unless they where in the game. You have to manually type in their user ID.

This is something that I suggested (to have the ability to get ids from names) and I didn't get much support.

Log in to vote
0
Answered by
Mapyo 20
7 years ago

I know this is an old post but it goes like this:

game.Players.PlayerAdded:connect(function(p)
    local d = p.UserId --d is player id.
end)
Log in to vote
0
Answered by
ew098 0
4 years ago

Well ik this is an old pos but you can get it by doing this:

local PlayerName = "PlayerNameHere" -- PlayerName

local UserId = game.Players:GetUserIdFromNameAsync(PlayerName) -- Answer
Log in to vote
-5
Answered by 10 years ago

Do you have multiplayer studio? The Plug-in? I could help you from there, but you're asking multiple questions, and they're all possible. At least to me, they are.

Username - Cataclyzmic, enable your server to Multiplayer Studio, and i can help edit it for you. As well as show you.

Log in to vote
-10
Answered by
yob67 -10
10 years ago

I'm not sure.......

3
Then why the heck did you answer the question? Bubby4j 231 — 10y

Answer this question