I am trying to make a script where if someone clicks a card they get it, but it also deletes the object in the workspace. Below is the code.
function touch(x)
local y = x.Backpack
local z = game.Lighting["[SCP] Card-L1"]
z:Clone().Parent = y
script.Disabled = true
script.Parent.ClickDetector.MaxActivationDistance = 1
Instance.Remove(script.Parent)
end
script.Parent.ClickDetector.MouseClick:connect(touch)

1 comment
:connect is deprecated, use :Connect instead