Passing custom parameters with the default

If I coded

local function destroyAccessories(object)
	--stuff
end
character.ChildAdded:Connect(destroyAccessories)

I don’t know how to pass another variable without losing the given parameter. I would try
...ded:Connect(destroyAccessories(given,stuffVar) thinking this would keep the given default paramater and induct my own stuffVar, but this doesn’t happen! As used with characterAdded.

1 Like

I’d suggest you should make this function instead:

local function destroyAccessories(given,stuffVar)
   --stuff
end

character.ChildAdded:Connect(function(given)
    --stuff
    destroyAccessories(given,stuffVar)
end)