I want to create a tool that is when is clicked it deletes itself and replicates another tool in the user's backpack. No matter what I do it does not work. What am I doing wrong?
Here is my script here: ( local script)
local tool = script.parent;
x = game.Players.LocalPlayer.Backpack
z = game.Lighting:WaitForChild("Cookie"):clone()
function onActivated()
z.Parent = x
tool: Destroy ()
end
tool.Activated:connect(onActivated)

3 comments
What do you mean?
What exactly is failing to work? Is there no tool when the tool activates or..?
There is no tool replicated when activated.