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