generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: How do i get the info of a player?

Previous Thread :: Next Thread 
SkyDoesMinecraft is not online. SkyDoesMinecraft
Joined: 15 Jul 2012
Total Posts: 656
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 is not online. 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
SkyDoesMinecraft is not online. SkyDoesMinecraft
Joined: 15 Jul 2012
Total Posts: 656
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
SkyDoesMinecraft is not online. SkyDoesMinecraft
Joined: 15 Jul 2012
Total Posts: 656
11 Mar 2014 11:10 PM
bump :3
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
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
SkyDoesMinecraft is not online. SkyDoesMinecraft
Joined: 15 Jul 2012
Total Posts: 656
12 Mar 2014 11:05 AM
But how do i do dat? D:
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
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 is not online. janthran
Joined: 15 May 2009
Total Posts: 17429
12 Mar 2014 12:17 PM
What info are you trying to get?
Report Abuse
SkyDoesMinecraft is not online. SkyDoesMinecraft
Joined: 15 Jul 2012
Total Posts: 656
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
SkyDoesMinecraft is not online. SkyDoesMinecraft
Joined: 15 Jul 2012
Total Posts: 656
13 Mar 2014 03:50 PM
bump? ;-;
Report Abuse
SkyDoesMinecraft is not online. SkyDoesMinecraft
Joined: 15 Jul 2012
Total Posts: 656
15 Mar 2014 04:23 PM
bump ;c
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
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
SkyDoesMinecraft is not online. SkyDoesMinecraft
Joined: 15 Jul 2012
Total Posts: 656
02 Apr 2014 05:19 PM
doesn't work D:

bump ;-;
Report Abuse
SkyDoesMinecraft is not online. SkyDoesMinecraft
Joined: 15 Jul 2012
Total Posts: 656
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
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
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 is not online. 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
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
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
SkyDoesMinecraft is not online. SkyDoesMinecraft
Joined: 15 Jul 2012
Total Posts: 656
03 Apr 2014 03:01 PM
Danke, brianush1
Report Abuse
MidnightDeveloper is not online. MidnightDeveloper
Joined: 08 Feb 2014
Total Posts: 1671
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
SkyDoesMinecraft is not online. SkyDoesMinecraft
Joined: 15 Jul 2012
Total Posts: 656
03 Apr 2014 03:19 PM
I'm ok. Thank you for the offer though
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image