I am making a system to load clothing in between games. For some reason, there are no errors, but no shirts or pants are being generated (although the pants to appear to be in the character model). Basically, I’m loading sent data from a teleport. The data is being sent over just fine, but the clothing just doesn’t seem to actually go on the character (yes, I’ve printed the character as well and it’s not nil.)
Here's what the server script looks like:
local sendTeleportDataEvent = ReplicatedStorage:WaitForChild("SendTeleportData")
--Modules
local customizationOptionsModule = require(7902172329).CustomizationsTable
print(customizationOptionsModule)
sendTeleportDataEvent.OnServerEvent:Connect(function(player,data)
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")
for section, choice in pairs(data) do
print(section,choice)
for _, descendant in pairs(character:GetDescendants()) do
if descendant:IsA("Shirt") or descendant:IsA("Pants") then
descendant:Destroy()
end
end
if section == "Shirts" then
local newShirt = Instance.new("Shirt")
newShirt.ShirtTemplate = customizationOptionsModule.Shirts[choice]
newShirt.Parent = character
print(newShirt)
elseif section == "Pants" then
local newPants = Instance.new("Pants")
print(customizationOptionsModule.Pants[choice])
newPants.PantsTemplate = customizationOptionsModule.Pants[choice]
newPants.Name = "Newpants"
newPants.Parent = character
print(newPants.PantsTemplate)
end
end
end)
Here’s the place file if you want to see for yourself (It’s been slightly modified to get data locally instead of from a different place, but still functions the same way it would):
customization.rbxl (47.5 KB)
Does anyone have any idea why nothing would be getting created?