Click an item to pick it up

please try new

script.Parent.Handle:WaitForChild("ClickDetector").MouseClick:Connect(function(player)
	script.Parent:Clone().Parent = player.Backpack
end)

Ok It kind of works, but there is a small error. When I click it it puts it in my inventory and keeps inf copies on the table. But when I take the smore out it teleports me right to where I grabbed it.

You should unanchor the handle part

Ok It now works! But I want to add something real fast. Is there a way to make it so they can only grab 1?

script.Parent.Handle:WaitForChild("ClickDetector").MouseClick:Connect(function(player)
if not player.Backpack.Smore then
	script.Parent:Clone().Parent = player.Backpack
 end
end)

Now I can’t even pick it up anymore.

Try this

script.Parent.Handle:WaitForChild("ClickDetector").MouseClick:Connect(function(player)
if not player.Backpack:FindFirstChild("Smore") then
	script.Parent:Clone().Parent = player.Backpack
 end
end)
1 Like

Thank you for all the help!! (char limit)

One problem, when I touch it I pick it up. I already got rid of the Touch part.

1 Like

Can you please elaborate? We can’t help you if we don’t have enough info.

If I understand that right you don’t want to pick it up when you touch it. If that’s the case all you have to do it turn off CanTouch in the tool’s handle

1 Like

This topic already solved.
[char limit.]

2 Likes