How can I detect if a player owns limited items from the catalog?
I dont think theres a way to check if a user owns a limited but you can check if the player is currently wearing a limited item.
local OwnsLimited = function(Player)
local Market = game:GetService("MarketplaceService")
local Character = Player.Character or Player.CharacterAdded:Wait()
local HumDescription = Player.Character:WaitForChild("Humanoid"):WaitForChild("HumanoidDescription")
for i,v in pairs(HumDescription:GetAccessories(true)) do
local success, result = pcall(function()
return Market:GetProductInfo(v.AssetId)
end)
if (success) and (result) then
if (result.IsLimited == true) then
return true
end
end
end
return false
end
print(OwnsLimited(game:GetService("Players").LocalPlayer))
I’m pretty sure there is, since most games like Trade Hangout know which limiteds the user owns. Thanks anyway!
Trade Hangout might be using a bot account on a remote server to get that information.
You can host a bot that controls a roblox account on something like an Amazon Web Services server, and then you can use a javascript package called “noblox.js” to access web-related information like what limiteds a player owns. In your ROBLOX game, you can use HttpService to communicate with your bot account, and that allows you to essentially read anything on the roblox website entirely in code.
Specifically for your use case, you would want to use the noblox.js method getCollectibles(…)
(you can see it here: noblox.js Global)
If you actually go through with this, noblox.js has tutorials on their main page: https://noblox.js.org/
And you’ll need to use the ROBLOX HttpService API: HttpService | Roblox Creator Documentation
As for server hosting – in the past it was possible to host a ROBLOX bot on a free service like glitch.com or repl.it – and by all means, those are excellent places to get started. However, ROBLOX added a security feature a year or two ago that logs out your bot account if the IP address of the bot’s server changes geographical region. With repl.it or glitch.com, you don’t control where in the world the server is hosted, and every 12 hours or so it can move which means that your bot account would get logged out and you would have to manually sign the bot account into roblox again (you unfortunately can’t log into an account with only code – but for good reason. security).
TLDR: to my knowledge, you have to host your bot, written in javascript, on a proper server hosting platform like AWS or DigitalOcean, which is a bit more intensive.
Although you could host the bot on your own computer, but then it would have to be running constantly for a game.
You could use a free proxy like roproxy, like this
local HttpService = game:GetService("HttpService")
local url = "https://inventory.roproxy.com/v1/users/%s/assets/collectibles"
local function getLimiteds(userId: number)
local success, result = pcall(HttpService.GetAsync, HttpService, string.format(url, userId))
if not success then return false, result end
local result = HttpService:JSONDecode(result)
return true, result
end
local success, result = getLimiteds(1)
if success then
-- Got it
for _, item in result.data do
print(item)
end
else
-- Failed to get
warn(result)
end
Or, you could host it yourself like Rockraider400 said
I get the warning “HttpError: TlsVerificationFail” any idea what it means? Edit: Nvm, my internet was blocking the website. Thank you so much!
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.