|
| 11 Mar 2014 01:40 PM |
By this i mean,
How can I get a players NAME by userId or any other method?
I ran my user id on the MarketService and outputed as this:
{"AssetTypeId":10,"IconImageAssetId":0,"IsNew":false,"Updated":"2010-07-02T02:04:28.033Z","Remaining":"null","ProductId":0,"MinimumMembershipLevel":0,"Created":"2010-07-02T02:04:28.033Z","Creator":{"Name":"sroonik","Id":2188284},"IsLimited":false,"ContentRatingTypeId":0,"IsPublicDomain":false,"AssetId":29907318,"Name":":3","IsForSale":false,"IsLimitedUnique":false,"PriceInRobux":"null","PriceInTickets":"null","Sales":0}
Which is not my character. ;c |
|
|
| Report Abuse |
|
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
|
| 11 Mar 2014 01:49 PM |
| Character id and assetId are 2 seperate things. The way you get your personal info is probably by HttpService |
|
|
| Report Abuse |
|
|
|
| 11 Mar 2014 02:14 PM |
But how would i use HttpService to get a players information?
I've never actually experimented with HttpService yet so i'm clueless. |
|
|
| Report Abuse |
|
|
| |
|
|
| 11 Mar 2014 11:19 PM |
| As far as I know, the only thing you can get with the available APIs is a player's Username form their UserId. |
|
|
| Report Abuse |
|
|
| |
|
|
| 12 Mar 2014 11:27 AM |
You could probably make a table, probably not what you wanted, but seriously
UserName = {}
UserID = {}
game.Players.PlayerAdded:connect(function(p) table.insert(UserName, p.Name) table.insert(UserID, p.UserID) end)
Then use the DataStore (I don't know much about it so sorry, can't provide an example) to store it. With that, you can do it with pretty much anybody who joins the game. I know this probably wasn't what you wanted, but you could store it now, and use it when necessary. It is the best I can do, but at least now you can do something like this;
for i = 1,#UserName do local User = UserName[i] local UserID = UserID[i] --WHATEVER YOU NEED TO DO TO THE PLAYER end
Once again, this is the best I can offer you, as I have no idea how to use stuff like httpservice. |
|
|
| Report Abuse |
|
|
janthran
|
  |
| Joined: 15 May 2009 |
| Total Posts: 17429 |
|
|
| 12 Mar 2014 12:17 PM |
| What info are you trying to get? |
|
|
| Report Abuse |
|
|
|
| 13 Mar 2014 11:14 AM |
| The info i'm trying to get is the player's name from the userid. They can either be in and out of game for me to do this. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 16 Mar 2014 07:07 AM |
Since your bumping, I decided to do a bit of research, it must be awfully important to you. I'm not sure if this works but I think I do, to my understanding at least.
hs = game:GetService("HttpService")
username = hs:GetUsernameById("http : / / rproxy . tk / rapi / API / ID_HERE") --Returns their username
userid = hs:GetIdByUsername("http : / / rproxy . tk / rapi / API / USERNAME_HERE") --Returns their ID
usernames = hs:GetIdByUsername("http : / / rproxy . tk / rapi / API / ID_HERE") --Returns a JSONString array of usernames (They can change them...)
Make sure you have httpservice enabled. Don'y forget to take out the spaces in the links. |
|
|
| Report Abuse |
|
|
| |
|
|
| 02 Apr 2014 05:25 PM |
| oh, and when i ran the script it said getnamebyuserid or sumthing was not a valid member of the httpservice, and when i fixed the script. it returned as their was no name or userid found. |
|
|
| Report Abuse |
|
|
|
| 02 Apr 2014 05:40 PM |
Errrr... if your going it to people in-game
function GetIdFromUser(plr) Found = false for _,v in pairs(game.Players:GetPlayers()) do if v.Name == plr then id = v.userId Found = true end if Found == false then print("Unable to find player ".. plr .."") elseif Found == true then print("Player found! Id: ".. id .."") end end
function GetUsernameFromId(id) Found = false for _,v in pairs(game.Players:GetPlayers()) do if v.userId == user then name = v.Name Found = true end if Found == false then print("Unable to find player with the username ".. name .."")) elseif Found == true then print("Player found! Username: ".. name .."") end end
Is that what you were looking for? |
|
|
| Report Abuse |
|
|
brianush1
|
  |
| Joined: 12 Sep 2009 |
| Total Posts: 90 |
|
|
| 02 Apr 2014 05:47 PM |
function GetUsernameFromID(ID) local ID=tonumber(ID) if not ID then return end local sets=game:service"InsertService":GetUserSets(ID) for k,v in next,sets do if v.Name=="My Models"then return v.CreatorName end end end print(UsernameFromID(261))
-- What this will do is get the "My Models" set from the user ID, and see the owner's name of the set, from the set information. I'm suprised nobody mentioned this. |
|
|
| Report Abuse |
|
|
|
| 02 Apr 2014 05:58 PM |
| How do you get a specific I'd, and not just shedletsky? To use later on, instead of printing it. |
|
|
| Report Abuse |
|
|
| |
|
|
| 03 Apr 2014 03:06 PM |
| SkyDoesMinecraft, I have a custom ROBLOX API if you want to do this in only 1 or 2 lines. |
|
|
| Report Abuse |
|
|
|
| 03 Apr 2014 03:19 PM |
| I'm ok. Thank you for the offer though |
|
|
| Report Abuse |
|
|