-
What do you want to achieve?
A script that add 1 points if you own clothing from the group -
What is the issue?
Script dont run -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tried looking for errors
This is a server script
local Players = game:GetService("Players")
local MarketplaceService = game:GetService("MarketplaceService")
local PlayerOwnsAsset = MarketplaceService.PlayerOwnsAsset
local Http = game:GetService("HttpService")
local Url = "https://catalog.roproxy.com/v1/search/items/details?Category=3&CreatorType=2&IncludeNotForSale=true&Limit=30&CreatorTargetId=12471114"
local clothesIds = Http:JSONDecode(Http:GetAsync(Url))
Players.PlayerAdded:Connect(function(player)
for i, item in ipairs(#clothesIds["data"]) do
print("a")
local clothing = player:FindFirstChild("Clothing") or Instance.new("IntValue", player)
local success, doesPlayerOwnAsset = pcall(PlayerOwnsAsset, MarketplaceService, player, clothesIds["data"]["id"])
if doesPlayerOwnAsset then
clothing.Value = clothing.Value + 1
print("b")
else
print(clothing.Value)
print("c")
end
end
end)