Cloning tool removes it from workspace

All I did was

     local clone = tool:Clone()
     clone.Parent = player.Backpack   

Why does doing this remove the tool (with it’s Handle) from where I kept it?

Here’s what I mean

Instance:Clone() should only create a clone whose Parent property is nil, not remove and parent the instance entirely right?

Is there a different way to do this with tools or something?

1 Like

I think your issue here is that you may have forgotten that touching a tool that is laying in the workspace automatically puts it in your inventory.

Cloning an object does not remove it from the parent it was currently inside of.

If you want the tools inside game.Workspace.Parts to stay in the workspace and have the player receive a copy of the tool, then a way you could accomplish this would be to move the folder “parts” to ReplicatedStorage or ServerStorage , copy the handles and place them into the the Workspace where you want them, and move a copy of your script into each handle with code like this:

local StorageUsed = game:GetService( --choose ReplicatedStorage or ServerStorage )
local ToolName = --put in GoodTool, NiceTool, or Tool, etc, according to which tool you want to clone

script.Parent.Touched:Connect(function(part)
if part.Parent:FindFirstChildOfClass("Humanoid") ~= nil then
local clone = StorageUsed.parts[ToolName]:Clone()
clone.Parent = game:GetService("Players"):GetPlayerFromCharacter(part.Parent).Backpack
end
end)

Oh yeah, thanks for reminding me about that

1 Like