Hello! I am encountering an issue with applying clothing templates onto characters. I would like to know how to fix my script to do this. I have tried searching up answers, looking through articles and I still haven’t found a solution. This is my script:
local function onOutfitSave(player, characterNumber, shirt, pants)
local character = "Character ".. characterNumber
if workspace.Buildings["Player Store 1"]["Store Owner"].Value == player.Name then
workspace.Buildings["Player Store 1"].Outfits[character]["Shirt Asset ID"].Value = shirt
local LoadedShirt = game:GetService("InsertService"):LoadAsset(shirt)
workspace.Buildings["Player Store 1"].Outfits[character].Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=".. LoadedShirt.Shirt.ShirtTemplate
workspace.Buildings["Player Store 1"].Outfits[character]["Pants Asset ID"].Value = pants
local LoadedPants = game:GetService("InsertService"):LoadAsset(pants)
workspace.Buildings["Player Store 1"].Outfits[character].Pants.PantsTemplate = "http://www.roblox.com/asset/?id=".. LoadedPants.Pants.PantsTemplate
end
end
game.ReplicatedStorage["Save Outfit"].OnServerEvent:Connect(onOutfitSave)