|
| 16 Dec 2016 11:07 PM |
How would I check if a player owns an item without them even playing the game? I've got the player id and the item id, but how do I check them without them playing?
Thanks.
~MightyDantheman~ |
|
|
| Report Abuse |
|
|
DataStore
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 8540 |
|
|
| 16 Dec 2016 11:10 PM |
| So far as I'm aware, you'd need to use an external API through HttpService. |
|
|
| Report Abuse |
|
|
|
| 16 Dec 2016 11:20 PM |
| http://wiki.roblox.com/index.php?title=API:Class/MarketplaceService/PlayerOwnsAsset |
|
|
| Report Abuse |
|
|
|
| 16 Dec 2016 11:30 PM |
How would I use HttpService to do this? I've never used it before.
~MightyDantheman~ |
|
|
| Report Abuse |
|
|
Astranite
|
  |
| Joined: 01 Dec 2016 |
| Total Posts: 562 |
|
|
| 16 Dec 2016 11:33 PM |
My slightly longer post got filtered, Intended_Pun you're wrong.
http://wiki.roblox.com/index.php?title=Web_APIs#User_APIs
Scroll down on here, it'll show you. Use Froast's site to send requests to ROBLOX.
|
|
|
| Report Abuse |
|
|
Astranite
|
  |
| Joined: 01 Dec 2016 |
| Total Posts: 562 |
|
|
| 16 Dec 2016 11:33 PM |
Short summary of HTTP & HttpService I wrote:
"HTTP (which stands for Hypertext Transfer Protocol) is the behind the scenes character that makes the world wide web possible. A protocol is a set of rules. Think of it this way - if you speak English, and I speak Spanish, we are speaking with two different protocols. But if you speak English, and I speak English, we can both communicate. For all computer-related protocols we have "standards", which are basically agreements. "Hey, everyone implement X in this particular way, and we'll all be able to work together with a common set of rules."
When you visit a web page, a lot of things happen, but to boil it down, all it's doing is using mainly two types of HTTP requests: GET requests and POST requests. A GET request gets a file from a web server, and a POST request sends data to it. When I click roblox.com's forums, I am using a lot of GET requests to pull data. This is mainly in the form of images and HTML documents. The browser is completely responsible for how the HTML and CSS and JavaScript shows up on your screen, the server just sends what it's got, it doesn't care how it looks to you. HTTP POST requests are usually for submitting form data. For example, when you post a reply to a thread, you are sending ROBLOX a POST request and it will handle the data you send to it. There's other types of HTTP requests, but you don't need to know about them for ROBLOX."
|
|
|
| Report Abuse |
|
|
|
| 16 Dec 2016 11:35 PM |
Wait, could I just use 'game:GetService("BadgeService"):UserHasBadge(player.userId, assetId)' and replace 'player.userId' directly with their id? If they weren't in the game, would this script still be able to check them?
~MightyDantheman~ |
|
|
| Report Abuse |
|
|
Astranite
|
  |
| Joined: 01 Dec 2016 |
| Total Posts: 562 |
|
|
| 16 Dec 2016 11:35 PM |
Anyway ROBLOX doesn't allow requests directly to their site, the general consensus is they don't want to let you DDoS ROBLOX with its own bandwith. Some proxies are also banned after a while too, ROBLOX is not very transparent, but you should be fine.
|
|
|
| Report Abuse |
|
|
Astranite
|
  |
| Joined: 01 Dec 2016 |
| Total Posts: 562 |
|
|
| 16 Dec 2016 11:36 PM |
If it's a badge you might be able to, I haven't checked, don't believe it will work with other types of assets.
|
|
|
| Report Abuse |
|
|
|
| 16 Dec 2016 11:44 PM |
Alright, I'll try it out. Thanks.
~MightyDantheman~ |
|
|
| Report Abuse |
|
|
Wrathsong
|
  |
| Joined: 05 Jul 2012 |
| Total Posts: 22393 |
|
|
| 17 Dec 2016 12:15 AM |
http://wiki.roblox.com/index.php?title=API:Class/Players/GetNameFromUserIdAsync
was gonna suggest that but apparently it only returns the name
Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow my twitch: twitch.tv/austinrblx |
|
|
| Report Abuse |
|
|