Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to check the assets of a player who is not in your game?

Asked by 6 years ago

I tried doing something like this but it doesn't appear to work very well. I have a feeling :GetPlayerByUserId doesn't work like I think it does.

plr = game:GetService("Players"):GetPlayerByUserId(5804891)


if game:GetService("MarketplaceService"):PlayerOwnsAsset(plr,30331986) then
        print(plr.Name .. " owns the Midnight Shades")
    else
        print(plr.Name .. " doesn't own the Midnight Shades")
end
0
:GetPlayerByUserId() doesn't work for players not in the game. theCJarmy7 1293 — 6y
0
What should I use to make the bottom part of the script work then? Nick1482 50 — 6y

1 answer

Log in to vote
0
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
6 years ago

To my knowledge, this currently isn't possible in the manner you're attempting. ROBLOX does offer API that could be of use for it, but the catch is that you can't send a GET request towards ROBLOX directly from a server. If you're willing to go the extra mile, you could easily find a free online service that will carry on your GET request for you, and in return you'd be getting your desired response.

Ad

Answer this question