Why my script dont run

  1. What do you want to achieve?
    A script that add 1 points if you own clothing from the group

  2. What is the issue?
    Script dont run

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

Do you get any errors in the Output Window?
Is it printing a, b or c in the Output?
What is (#clothesIds["data"])?

Update: this was a dumb error i put player it should be player.UserId

1 Like