I would like to check if a player’s inventory is public/private through a script. Is there a way to do this?
I’ve attempted to search for a solution, but I’m not able to find one.
Thank you!
I would like to check if a player’s inventory is public/private through a script. Is there a way to do this?
I’ve attempted to search for a solution, but I’m not able to find one.
Thank you!
Hey guys! Bumping this because I still need a solution lol
You would need to use a proxy (as you can’t access the Roblox api directly from the servers), to access the following API:
https://inventory.roblox.com/v1/users/USERIDGOESHERE/can-view-inventory
https://inventory.roblox.com/docs/index.html
It will tell you whether you can or can not view the inventory of the given user, AKA if their inventory is public or private
Thank you very much for the response!
I don’t have much experience with HTTP service. I tried to integrate this and failed haha
Would you mind providing more information about how to integrate this?
EDIT:
I found the solution and I got it working. This code certainly needs to be optimized, but for the time being it works. Here’s my code:
local HttpService = game:GetService("HttpService")
local userID = 784222768 -- your id here
local data = HttpService:JSONDecode(HttpService:GetAsync("https://inventory.roproxy.com/v1/users/".. userID .."/can-view-inventory"))
if data.canView == false then
print("Inventory private.")
else
print("Inventory public.")
end
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.