There’s nothing wrong with your function, it is something to do with your code that is using that function. But you could also add a checker if that object or the handle already exist.
Example
local function Setup()
-- If the handle already exists, then don't do anything.
if char:FindFirstChild("Handle") ~= nil then return end
...
end
Or
local isDoneCloning = false
local function Setup()
-- If the value of isDoneCloning variable is true, then don't do anything.
if isDoneCloning then return end
isDoneCloning = true
...
end
Would be better if you could give us more context other than the code you’ve provided. Just like what I said, it is something to do with your code that is using that function.
I was looking to give you more context and I had come across these lines of text
for i,v in pairs(game.Players:GetChildren()) do
repeat wait() until v.Character
setUp(v.Character)
v.CharacterAdded:Connect(function(char)
char:WaitForChild("Right Arm")
setUp(char)
end)
end
I must’ve accidently written them at different times not realizing that I had already made the first one before hand. That was just a oversight on my end
These both do the same thing, calling the function twice.