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: iterate until find place

Previous Thread :: Next Thread 
badfitz67 is not online. badfitz67
Joined: 03 Jun 2010
Total Posts: 13165
04 Sep 2016 10:36 AM
I'm making a place roulette but it's incredibly hard to find a random place using math.random

local PlaceID = math.random(1, 10471625)


is there a way I can iterate and choose a random number until it finds a place?



"Where's the Sarge, Syrus?" "He's up there, in the stars"
Report Abuse
Zawie is not online. Zawie
Joined: 04 Jul 2010
Total Posts: 6338
04 Sep 2016 10:37 AM
just loop it and keep on choosing random IDs until the ID is a place
Report Abuse
badfitz67 is not online. badfitz67
Joined: 03 Jun 2010
Total Posts: 13165
04 Sep 2016 10:38 AM
and how will i actually check if it's a place

you basically just said what I want to do with no solution


"Where's the Sarge, Syrus?" "He's up there, in the stars"
Report Abuse
Zawie is not online. Zawie
Joined: 04 Jul 2010
Total Posts: 6338
04 Sep 2016 10:40 AM
Well if you did the slightest of digging you would have found this
http://wiki.roblox.com/index.php?title=API:Class/MarketplaceService/GetProductInfo
See what the "AssetTypeId" is
Report Abuse
badfitz67 is not online. badfitz67
Joined: 03 Jun 2010
Total Posts: 13165
04 Sep 2016 10:41 AM
so if it isn't a place it'll return nil?


"Where's the Sarge, Syrus?" "He's up there, in the stars"
Report Abuse
Zawie is not online. Zawie
Joined: 04 Jul 2010
Total Posts: 6338
04 Sep 2016 10:46 AM
No it will return a dictionary and check if AssetTypeId is the TypeId for place. Which I don't remember, but you can easily search it up.
Report Abuse
badfitz67 is not online. badfitz67
Joined: 03 Jun 2010
Total Posts: 13165
04 Sep 2016 10:57 AM
So, will assettypeid be if it's not a place/anything?


"Where's the Sarge, Syrus?" "He's up there, in the stars"
Report Abuse
badfitz67 is not online. badfitz67
Joined: 03 Jun 2010
Total Posts: 13165
04 Sep 2016 10:58 AM
nvm


"Where's the Sarge, Syrus?" "He's up there, in the stars"
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
04 Sep 2016 10:59 AM
use markplace service and use pcall and product info to check if the type of asset is a place and if it is anything at all
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