I am currently trying to make a script that sets a target players shirt to an ID set through a command, the command executes perfectly fine but I am finding the issue that the ID’s that people would use to set their shirts would be from the marketplace and those ID’s dont work when setting player shirts in studio? How would I go about getting the working studio ID’s from the catalog ID’s??
function onSetShirt(player, playerName, ID)
local targetPlayer = Players:FindFirstChild(playerName)
if targetPlayer and targetPlayer.Character then
local humanoid = targetPlayer.Character:FindFirstChildOfClass("Humanoid")
if humanoid then
local success, errorMessage = pcall(function()
local shirt = targetPlayer.Character:WaitForChild("Shirt")
shirt.ShirtTemplate = ID
end)
if success then
print(player.Name .. " set " .. playerName .. "'s shirt to " .. ID)
else
warn("Failed to set shirt for", playerName, ":", errorMessage)
end
else
warn("Humanoid not found for player:", playerName)
end
else
warn("Player not found:", playerName)
end
end