I’m trying to figure out why when I change the player’s clothing, it just makes the player’s clothes go poof. (the clothes are still there, but it either doesn’t load or I don’t know what’s happening) Yes, the IDs are correct. itemid and itemid2 just links to a variable, so that’s all correct. Does anyone know what’s going on? (player is a variable as well, so don’t worry about that)
No, there’s nothing in the output.
Here’s my script:
local character = player.Character
if character then
local shirt = character:FindFirstChildOfClass("Shirt")
local pants = character:FindFirstChildOfClass("Pants")
if not shirt then
shirt = Instance.new("Shirt")
shirt.Name = "Shirt"
shirt.Parent = character
end
if not pants then
pants = Instance.new("Pants")
pants.Name = "Pants"
pants.Parent = character
end
shirt.ShirtTemplate = "http://www.roblox.com/asset/?id="..itemid
pants.PantsTemplate = "http://www.roblox.com/asset/?id="..itemid2
end
You could try using InsertService, it inserts the shirt ID into a model. This worked for me when I tested it in a game. You can do the same for the pants.
local itemid = script.Parent.Value.Value
local InsertService = game:GetService("InsertService")
local ShirtID = itemid -- ID from catalog
local model = InsertService:LoadAsset(ShirtID) -- it inserts it as a model
model.Shirt.Parent = script.Parent -- Or just get the model.Shirt.ShirtTemplate and set the Character's ShirtTemplate to that
I don’t think it’s possible, seen as you can’t change meshID’s or textureID’s on meshparts, I guess it works the same.
I guess an alternative is to delete the clothing (create a copy if they’re ever going to wear it again without respawning) and create an instance with the said ClothingTemplates which are going to parent to the character.
100% forgot to mention, this is a local script, quite sure loadasset doesn’t work on the client
Personally I have no idea why this is happening, this should’ve been very simple but the clothes look like they’re not loading in, even though there’s nothing in the output telling that and the clothes are still on Roblox & wearable