Cloning tools won't allow the tool to function

So I’m currently using the code below and while it successfully clones the tool to the players backpack it doesn’t let the player to actually use the tool. It’s meant so when you click and have the tool equipped it brings the tool to the players mouth but that doesn’t work at all. When you press backspace on the tool it removes it from the backpack like hows it supposed to but it also gets stuck to the players hand.

How would I make this script allow the tool to function?

local button1 = script.Parent.Frame.Frame:WaitForChild(“hotdog”)
local button2 = script.Parent.Frame.Frame:WaitForChild(“burger”)

button1.MouseButton1Down:Connect(function()

	local cloneTool = game.ReplicatedStorage.Food["Hot Dog"]:Clone()
	cloneTool.Parent = game.Players.LocalPlayer.Backpack

end)

button2.MouseButton1Down:Connect(function()

	local cloneTool = game.ReplicatedStorage.Food["Burger"]:Clone()
	cloneTool.Parent = game.Players.LocalPlayer.Backpack

end)

1 Like

If your tools have server scripts in them, the server scripts won’t work for security purposes. You need to use remotes here.

1 Like

Oh alright didn’t notice that. Thank you