So I wanted to make a button that once clicked, clones a Tool and places it in the player’s Backpack.
However, the issue is, when the Tool is cloned, scripts no longer work that are in the Tool!
Here is the script:
--// This is a LocalScript.
local Items = game.Workspace.Items
local Cookie = Items.Cookie
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
local CookieClone = Cookie:Clone()
CookieClone.Parent = player.Backpack
end)
If you clone a tool on the client-side and the script controlling the tool is a server-script, it won’t work because it wouldn’t know it got cloned in the first place.
The tool’s location wouldn’t change on the server-side.
Pass the tool name on the client, and on the server the player is automatically the first argument, and then search for the tool where you keep the tools with FindFirstChild, if it exists then clone it to the player’s backpack