Click an item to pick it up

I want it so there is a smore on a table, when the player clicks it they pick it up, but the smore is still on the table for others to pick up to. How is this possible? Here is my script:

script.OnTouched = false
script.Parent.MouseButton1 = true do
	script.Parent.OnTouched = true
		
	end
end
5 Likes

image

Put ClickDetector in Handle.

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

If this work, please mark this post as Solution!

1 Like

There seem to be many underlines under the script. I also don’t seem to be able to pick it up.

I found a typo but nvm I edited that :slight_smile:

Can I please have the edited version? Never mind I found it

Can you try this?

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

Don’t forget to add ClickDetector in Handle part

I did so but I still can’t pick it up. Even with the ClickDetector

Put script inside tool. not a Handle

You’d do it on the client, then.

Like this:
image

I still can’t pick it up. I made it look just like yours.

How would I do it in the client?

Can I see your Explorer?
(char limit)

image

try like

image

Oh sorry I made more typo :frowning:
This may work:

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

Sorry!

I already tried removing the ClickDetector in the handle. Does not work.

For a ClickDetector to work, you need to parent it to a BasePart