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 » Scripters
Home Search
 

Re: How do u get the user id of a player who isn't in game

Previous Thread :: Next Thread 
bojigglesmister2 is not online. bojigglesmister2
Joined: 26 Jun 2011
Total Posts: 1421
07 Dec 2015 01:10 PM
How
Report Abuse
Skyman772 is not online. Skyman772
Joined: 20 Mar 2012
Total Posts: 9305
07 Dec 2015 01:12 PM
Pretty sure that isn't possible.
Report Abuse
TheBenSquare is not online. TheBenSquare
Joined: 13 Dec 2009
Total Posts: 13604
07 Dec 2015 01:15 PM
It's possible. However, you need to use HttpService and you'll need the name of the player along with a proxy that supports the API. Here's the link to the wiki article that mentions it.

http://wiki.roblox.com/index.php?title=Web_APIs#Get_ID_from_username
Report Abuse
SaluteMeScrub is not online. SaluteMeScrub
Joined: 28 Dec 2013
Total Posts: 380
07 Dec 2015 01:17 PM
Depends, is it when the player leaves, or use a id with a username
Report Abuse
bojigglesmister2 is not online. bojigglesmister2
Joined: 26 Jun 2011
Total Posts: 1421
07 Dec 2015 01:35 PM
TheBen, you don't need httpservice to use that? Rob lox made the API for it :P
Report Abuse
TheBenSquare is not online. TheBenSquare
Joined: 13 Dec 2009
Total Posts: 13604
07 Dec 2015 01:37 PM
The API only works with HttpService which is why I mentioned HttpService.
Report Abuse
bojigglesmister2 is not online. bojigglesmister2
Joined: 26 Jun 2011
Total Posts: 1421
07 Dec 2015 01:42 PM
I don't know how to do this :/
Report Abuse
TheBenSquare is not online. TheBenSquare
Joined: 13 Dec 2009
Total Posts: 13604
07 Dec 2015 01:43 PM
http://wiki.roblox.com/index.php?title=Sending_HTTP_requests
Report Abuse
iMung is not online. iMung
Joined: 11 Jul 2013
Total Posts: 328
07 Dec 2015 01:43 PM
local I = Instance.new("IntValue", game.ServerStorage) game.Players.PlayerRemoving:connect(function(player) I.Value = player.userId end)
Report Abuse
bojigglesmister2 is not online. bojigglesmister2
Joined: 26 Jun 2011
Total Posts: 1421
07 Dec 2015 01:45 PM
iMung.. no
Report Abuse
bojigglesmister2 is not online. bojigglesmister2
Joined: 26 Jun 2011
Total Posts: 1421
07 Dec 2015 01:46 PM
@TheBen, links don't help me
Report Abuse
NetworkReplicated is not online. NetworkReplicated
Joined: 22 Dec 2010
Total Posts: 330
07 Dec 2015 01:49 PM
@iMung no. that is a horrible way of doing it

local http = game:service("HttpService")
function getUID(pName)
return http:JSONDecode(http:GetAsync(("http://api.rproxy.pw/users/get-by-username?username=%s":format(pName))))["Id"]
end
print(getUID("NetworkReplicated"))

That will print my UID (probably, testing it now)
Report Abuse
NetworkReplicated is not online. NetworkReplicated
Joined: 22 Dec 2010
Total Posts: 330
07 Dec 2015 01:50 PM
local http = game:service("HttpService")
function getUID(pName)
return http:JSONDecode(http:GetAsync(("http://api.rproxy.pw/users/get-by-username?username=%s"):format(pName)))["Id"]
end
print(getUID("NetworkReplicated"))

--/\ Use that
--make sure to enable HttpService
Report Abuse
bojigglesmister2 is not online. bojigglesmister2
Joined: 26 Jun 2011
Total Posts: 1421
07 Dec 2015 01:53 PM
How did you learn HttpService Network?

Something I can't comprehend.. Ive tried so many tutorials and articles.
Report Abuse
NetworkReplicated is not online. NetworkReplicated
Joined: 22 Dec 2010
Total Posts: 330
07 Dec 2015 01:59 PM
/\ Trial and error.

Here is how it works:

(HttpService needs to be enabled)

First, at the top of your script, make a global variable called 'http' (not needed, just makes it easier)
local http = game:service("HttpService")
There.
Now, you need to get something. Get requests are the most common, this is like going to that site in your browser.

Do this through the method:

http:GetAsync("http://www.google.com")

That will get you the HTML source code for google.

You can print it with:
local google_html = http:GetAsync("http://www.google.com")
print(tostring(google_html))


There are other types, but that is the basic.
Report Abuse
bojigglesmister2 is not online. bojigglesmister2
Joined: 26 Jun 2011
Total Posts: 1421
07 Dec 2015 02:04 PM
I know that but how would I use the html to get things like, if I wanted to get someones Last Tweet on twitter? idk how to go through the html to get it
Report Abuse
SaluteMeScrub is not online. SaluteMeScrub
Joined: 28 Dec 2013
Total Posts: 380
07 Dec 2015 02:32 PM
For twitter's person last tweet, you can use Twitter's API, or even use string.match
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
07 Dec 2015 02:44 PM
lol

http://wiki.roblox.com/index.php?title=API:Class/Players/GetNameFromUserIdAsync
http://wiki.roblox.com/index.php?title=API:Class/Players/GetUserIdFromNameAsync
Report Abuse
TERMANIZED is not online. TERMANIZED
Joined: 18 May 2013
Total Posts: 256
07 Dec 2015 02:47 PM
Thank god someone who actually knows this posted
Im honestly dissapointed lol
Report Abuse
Customality is not online. Customality
Joined: 11 Aug 2015
Total Posts: 590
07 Dec 2015 02:47 PM
^Was thinking about it =3
Report Abuse
bojigglesmister2 is not online. bojigglesmister2
Joined: 26 Jun 2011
Total Posts: 1421
07 Dec 2015 02:50 PM
Then why didn't u guys post it?

Report Abuse
TERMANIZED is not online. TERMANIZED
Joined: 18 May 2013
Total Posts: 256
07 Dec 2015 02:50 PM
Because i just came on this forum
I was just about to then i realized chim already posted it
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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