Cloning Appends Number Without My Consent

Straight to the point.

Cloning an item appends a 2 if an item with the same name is listed. Annoying, but I can work around it. Tried using a folder with a unique name (HttpService Guid) and still didn’t work. I need help.

local guidfold = Instance.new("Folder")
guidfold.Parent = workspace
guidfold.Name = game.HttpService:GenerateGUID()

--// data.PetsEquipped is "Maxwell"
local tClo = resources.Avatar.Pets:FindFirstChild(data.PetsEquipped):Clone()
tClo.Parent = guidfold
tClo.Name = data.PetsEquipped
print(tClo) --// Prints Maxwell2

Why do you need a folder with unique name?
Also please cache referances since IR is pretty expensive to invoke __index inside roblox instance and GETTABLEKS in general are pretty expensive.

:Clone method does not rename anything, i have no idea what are you talking about.
https://create.roblox.com/docs/reference/engine/classes/Instance#Clone

1 Like

You’re right, it must be an issue with me.

It’s something with putting the cloned object that appends the 2

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.