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 to Find a Place Name from a Place ID

Previous Thread :: Next Thread 
AkaLua is not online. AkaLua
Joined: 27 Jul 2012
Total Posts: 526
29 Dec 2015 11:21 AM
function getName(id) --Get the name of a place from the place id
local httpService = game:GetService("HttpService") --Get the http service
local recieved = httpService:GetAsync("http://rproxy.pw/games/"..id.."/Auto-Scripter",true) --Give it a known place name with a different ID, redirecting to the new place
local numberFoundTitleFirst = string.find(recieved,"title") --Try find the word title in the large string we recieved
recieved = string.sub(recieved,numberFoundTitleFirst) --String.sub it to make sure if have all text up to the word title removed
local numberFoundROBLOXFirst = string.find(recieved,"ROBLOX") --Look for the word ROBLOX
local placeName = string.sub(recieved,7,numberFoundROBLOXFirst-3) --String.sub again from 7(title>) until ROBLOX appears, -3 (Which accounts for ' - ' inbetween the name and the word)
return(placeName) --Return the name
end
print(getName(318574526)) --Get the name of a place


There is probably a more efficient way to do this, and it won't work if the place has the word 'ROBLOX' in the title, but I couldn't find a way on the Wiki so I fiddled with HttpService until it worked!


-____________________________-
Report Abuse
CounterforceStudio is not online. CounterforceStudio
Joined: 17 Nov 2013
Total Posts: 1067
29 Dec 2015 11:31 AM
Try MarketPlaceService
Report Abuse
AkaLua is not online. AkaLua
Joined: 27 Jul 2012
Total Posts: 526
29 Dec 2015 01:50 PM
GetProductInfo?


-____________________________-
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