Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

2 comments

0

:GetPlayerByUserId() doesn't work for players not in the game.

0

What should I use to make the bottom part of the script work then?

1 answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.