Can't clone shirt template id

Hi, I’m currently trying to make a Uniform saving system using a button. The problem is that if you save your Uniform into a folder it wouldn’t copy the actual shirt.

This is the actual shirt I saved:

image

And this is the one you get when you save it:

Screenshot 2024-01-08 201210

It copies the original roblox shirt instead of the custom template I made. And this is the script I made:

local Player = game.Players.LocalPlayer
local Char = Player.Character

local UniformPack = Player:FindFirstChild("UniformPack")

local MainShirt = game.Workspace[Player.Name]:WaitForChild("Shirt")
local MainPants = game.Workspace[Player.Name]:WaitForChild("Pants")
local MainShirtClone = MainShirt:Clone()
local MainPantsClone = MainPants:Clone()

script.Parent.MouseButton1Click:Connect(function()
	UniformPack:ClearAllChildren()
	MainShirtClone.Parent = UniformPack
	MainPantsClone.Parent = UniformPack
end)

I’m still trying to find a solution but I can’t find any posts related to this.

4 Likes

Is that server side script or client side script?

1 Like

It’s a Local Script inside the button.

1 Like

Alright, give me 5 minutes I’m going to hop in studio and test it.

1 Like

For me all works fine, shirt and pants are the same.

1 Like

Maybe try using a shirt giver but the shirt uses decals

It works if I use:

	MainShirt:Clone()
	MainShirt.Parent = UniformPack
	MainPants:Clone()
	MainPants.Parent = UniformPack

But using the original script I made doesn’t work.

here i made your script performance better, sometimes it can break.
i replaced

local Player = game.Players.LocalPlayer
local Char = Player.Character

local UniformPack = Player:FindFirstChild("UniformPack")

local MainShirt = game.Workspace[Player.Name]:WaitForChild("Shirt")
local MainPants = game.Workspace[Player.Name]:WaitForChild("Pants")
local MainShirtClone = MainShirt:Clone()
local MainPantsClone = MainPants:Clone()

to

local Player = game.Players.LocalPlayer
local Char = Player.Character or Player.Character:Wait()

local UniformPack = Player:FindFirstChild("UniformPack")

local MainShirt = Char:WaitForChild("Shirt")
local MainPants = Char:WaitForChild("Pants")
local MainShirtClone = MainShirt:Clone()
local MainPantsClone = MainPants:Clone()

That should help make your script a little better

Um thanks but this is still not the solution for this.