Tool's children disappear when it is cloned

Hi, I’m writing a piece of code for a shop GUI in my game and when I clone a tool to the players backpack, it appears as if the children of the tool have “disappeared”. I have no idea why it would be doing this, and I have tried to yield the script to make sure the tool has loaded properly, but it still doesn’t work.
The tool works perfectly fine when placed in starter pack, just not when it is cloned.

I am cloning the tool from a server script.

This is my code:
SERVER SCRIPT:

repstorage.events.ItemPurchase.OnServerEvent:Connect(function(player, itemName)
	if servstorage:WaitForChild(itemName) then
		local price = servstorage[itemName].Price.Value

		local currencyStore = DataStore2("currency", player)
		if currencyStore:Get(defaultmoney) >= price then
			currencyStore:Increment(-price)
			
			local item = servstorage:WaitForChild(itemName)
			item:Clone()
			item.Parent = player.Backpack
			
		end
	end
end)

CLIENT SCRIPT:

local servstorage = game:GetService("ServerStorage")
local repstorage = game:GetService("ReplicatedStorage")
local players = game:GetService("Players")

local clickDetector = game.Workspace.rocketshop.ClickDetector



clickDetector.MouseClick:Connect(function()
	if not players.LocalPlayer.PlayerGui:FindFirstChild("PurchaseConfirmation") then
		local itemName = clickDetector.Parent.Item.Value

		if not players.LocalPlayer.Backpack:FindFirstChild(itemName) then
			

			local gui = repstorage.Gui.PurchaseConfirmation:Clone()
			
			gui.Parent = players.LocalPlayer.PlayerGui

			gui.Frame.Confirm.MouseButton1Click:Connect(function()
				repstorage.events.ItemPurchase:FireServer(itemName)
				gui:Destroy()
			end)

			gui.Frame.Cancel.MouseButton1Click:Connect(function()
				gui:Destroy()
			end)
		end
	end
end)

Error in the output:

Tool’s children:

tool

Any help would be greatly appreciated!

you cannot call server storage from a local script

You’re doing item:Clone() and then changing the values of the old item instead.

local item = servstorage:WaitForChild(itemName)
			item:Clone()
			item.Parent = player.Backpack

You can add :Clone() in the item variable instead.
servstorage:WaitForChild(itemname):Clone()

That too

Serverstorage isn’t being used in that script, I just called it and then didn’t use it…

I just tried that and it gave the same error.

Oh, it seems like you might be trying to call the Equip method on a non-Tool object. Double-check that the object you’re trying to equip is actually a Tool and not something else.

Can you show the code from “RocketLauncher.Client”?

The object is definitely a tool, and the “Equip” part is a bool value that is a child of the tool.

RocketLauncher.Client:

local Tool = script.Parent
local Player = game.Players.LocalPlayer
local Char = game.Workspace:WaitForChild(Player.Name)
local Humanoid = Char:WaitForChild("Humanoid")
local Remote = Tool:WaitForChild("MouseLoc")
local Enabled = Tool.Equip
local Mouse = game.Players.LocalPlayer:GetMouse()
local anim = Humanoid:LoadAnimation(script.Animation)
local cam = workspace.Camera

local fovMax = { FieldOfView = 70 - 40 }
local fovMin = { FieldOfView = 70 }
local thing = game.Workspace.CurrentCamera
local tweencc = game.TweenService:Create(thing, TweenInfo.new(0.4, Enum.EasingStyle.Sine), fovMax)
local tween2cc = game.TweenService:Create(thing, TweenInfo.new(0.4, Enum.EasingStyle.Sine), fovMin)



function Remote.OnClientInvoke()
	return Mouse.Hit.p
end

Tool.Equipped:Connect(function()
	anim:Play()
	Enabled.Value = true

	

	
end)

Tool.Unequipped:Connect(function()
	anim:Stop()
	Enabled.Value = false

end)

local function onInputBegan(input, process)
	if (process) then return; end
	if (input.UserInputType == Enum.UserInputType.MouseButton2) and Enabled.Value == true then
		
		
		
	end
end

local function onInputEnded(input, process)
	if (process) then return; end
	if (input.UserInputType == Enum.UserInputType.MouseButton2) and Enabled.Value == true then
		
		
	end
end

game:GetService("UserInputService").InputBegan:Connect(onInputBegan);
game:GetService("UserInputService").InputEnded:Connect(onInputEnded);

can you say what’s the error and and in which line the error is in ?

The error was in the original post, but here it is again:

The only thing I can think of is that it’s mistaking Tool.Equip as some sort of event call instead of a path for a property. Does adding :WaitForChild(“Equip”) fix it?

I just tested it and I am getting the exact error as before.

Would it not be worth setting Enabled to false in the script, completely removing the BoolValue, and then set Enabled to true/false on Equipping the tool?

I tried that but other children of the tool are also missing, it’s not just the BoolValue. I believe the only parts of the tool that exist after it is cloned are the scripts and the parts that are welded to the handle, which isn’t what I am really looking for as the BoolValue and parts like the MouseLoc are needed for parts of my scripts to work.
Also, the tool works perfectly fine when just placed in the starterpack and used that way, it’s just when it is cloned that it breaks this way…