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