Hi. I have this script in a tool to make it "Click to pickup"
local destroyMe = script.Parent:WaitForChild("Handle"):FindFirstChild("TouchInterest")
local tool = script.Parent
if destroyMe then
destroyMe:Destroy()
end
script.Parent.ClickDetector.MouseClick:Connect(function(plr)
tool.Parent = plr.Backpack
end)
And it works! But when i drop tool from Backpack ("tool.Parent = game.Workspace") ClickDetector not detecting any clicks anymore. Am i doing something wrong?
Thanks guys ;)
SOLUTION Before adding tool to backpack, make it parent nil!
script.Parent.ClickDetector.MouseClick:Connect(function(plr)
tool.Parent = nil
tool.Parent = plr.Backpack
end)

5 comments
I tried out your code, and it seems to be working fine for me. Any other details we should know?
I Found some useful info. If you drop it using backspace it works. I use Custom inventory, so tool is "CanBeDropped = false" and i drop it through script (Change its parent to workspace) and it stops working
Interesting. Give me a few minutes and I'll see what I can find out for you. I see what you're talking about.
I was messing around with your script and noticed that even once the object was placed back in the Workspace by a script, it was stating that it was a child of the player's backpack still. One thing you could do, potentially, is set the tool's parent to nil and then to the player's backpack. That worked for me, though I don't know how efficient that is.
Oh! Thanks for info! It worked for me)