I made a script for a game in serverscript service that adds a leaderboard and checks if they own a shirt:
game.Players.PlayerAdded:Connect(function(player)
local MarketplaceService = game:GetService()
local ASSET_ID = 471780910
local PlayerOwnsAsset = MarketplaceService.PlayerOwnsAsset
local leaderstats = Instance.new("Folder")
leaderstats.Parent = player
leaderstats.Name = "leaderstats"
local Rank = Instance.new("StringValue")
Rank.Parent = leaderstats
Rank.Name = "Role"
Rank.Value = player:GetRoleInGroup(5667550)
local Priority = Instance.new("BoolValue")
Priority.Parent = player
Priority.Name = "Priority"
Priority.Value = false
local success, doesPlayerOwnAsset = pcall(PlayerOwnsAsset, MarketplaceService, player, ASSET_ID)
if doesPlayerOwnAsset then
Priority.Value = true
else
print(player.Name .. " doesn't own priority")
end
end)
It worked when it was just the script to add a leaderboard but when I implemented the shirt check system it stopped creating new instances. I want it to check if a player owns an asset then if they do than it sets a boolvalue in the player to true. And now it doesnt create the value or the leaderstats.

4 comments
What service are you exactly getting? local MarketplaceService = game:GetService()
wait wut did i somehow remove it
before it said marketplaceservice i must have somehow removed it
Now the values are showing up but its not changing the boolvalue if you own the asset or not