Cloning model stops working after 2 times

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want that when every time that the player equips the tool, that a gun model gets cloned and welded to the character

  2. What is the issue? Include screenshots / videos if possible!
    After cloning 2 times, the cloning seems to stop working

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I tried to put prints in the script to see if it doesn’t run, but it prints the lines but it doesnt clone the model, I also looked in the dev forums and couldnt find my problem listed

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

This is the function that handles the cloning

equip.OnServerEvent:Connect(function(player)
	local char = player.Character
	local hum = char.Humanoid
	
	local gunModel = gunFolder:FindFirstChild("MAL-12_Model"):Clone()
    Print("Cloned")
	gunModel.Parent = char
	local motor6d = Instance.new("Motor6D")
	motor6d.Parent = char:FindFirstChild("Right Arm")
	motor6d.Part0 = motor6d.Parent
	motor6d.Part1 = gunModel.Handle
	motor6d.C0 = motor6d.Part1.CFrame:Inverse() * motor6d.Part0.CFrame
	
	local holdAnim = hum:LoadAnimation(script:FindFirstChild("Hold_Animation"))
	holdAnim:Play()
end)

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

Is the gun a tool? if so,

I would recommend instead of attaching the equip of the tool as an event, I recommend doing

tool.Equipped:Connect(function()
	local char = script.Parent.Parent
	local hum = char.Humanoid
	
	local gunModel = gunFolder:FindFirstChild("MAL-12_Model"):Clone()
    Print("Cloned")
	gunModel.Parent = char
	local motor6d = Instance.new("Motor6D")
	motor6d.Parent = char:FindFirstChild("Right Arm")
	motor6d.Part0 = motor6d.Parent
	motor6d.Part1 = gunModel.Handle
	motor6d.C0 = motor6d.Part1.CFrame:Inverse() * motor6d.Part0.CFrame
	
	local holdAnim = hum:LoadAnimation(script:FindFirstChild("Hold_Animation"))
	holdAnim:Play()
end)

(sad to see devforum posts without any responses)