Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to check if a player has a shirt?

Asked by 4 years ago
local shirtid = 2037398414

local players = game:GetService("Players")
local mps = game:GetService("MarketplaceService")
local shirtown = mps.PlayerOwnsAsset

players.PlayerAdded:Connect(function(player)
    local success, doesPlayerOwnAsset = pcall(shirtown, mps, player, shirtid)
    if doesPlayerOwnAsset then
        local shirt = workspace:FindFirstChild(player.Name):WaitForChild("Shirt")
        shirt.ShirtTemplate = "http://www.roblox.com/asset/?id="..shirtid
    else
        print("Player doesn't have shirt.")
    end
end)

All it does is make my shirt disappear

0
Use "rbxassetid://"..shirtid. You can also immediately reference the Players affiliated avatar by calling Player.Character. Ziffixture 6913 — 4y
0
Doesnt work, my shirt still disappears AcrylixDev 119 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

=====

Ad

Answer this question