So sounds confusing but ill try to explain. So i want to make a leader board of how many hats that player has. So what im trying to get at is are you able to sync players hats from there inventory and turning it into a LeaderStat thing. If need more info just say or go to my twitter @evthehuman https://twitter.com/evthehuman
MarketPlaceService - As of the Service that handles player assets, I would assume there isn't a function. Unless, you want to create a variable for every Hat ID there is in a table and check if the player owns that hat, but that's pretty much a mess and memory consuming, as there are plenty of hats.
Example:
local marketPlaceService = game:GetService("MarketplaceService") local possibleHats = {"Hat1_ID","Hat2_ID","Hat3_ID","And So On"} game.Players.PlayerAdded:Connect(function(player) for _,hat in pairs(possibleHats) do if marketPlaceService:PlayerOwnsAsset(hat) then local hatsValue = player:WaitForChild("leaderstats"):FindFirstChild("Hats") hatsValue.Value = hatsValue + 1 print("Player Owns Hat") end end end)
Hope this gave you an understanding of why this is a hassle and why you wouldn't be able to do this so easily.
~killerbrenden