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?
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.
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.
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.
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.
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)
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
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.