Tool breaks when cloned?

If I clone a tool into the player’s backpack nothing inside of it will run
I don’t get any errors either, and everything works but not the tool.
what happens

givetoolevent.OnServerEvent:Connect(function(player, v)
	v:Clone().Parent = player.Backpack
end)

mouse.Button1Down:Connect(function()
if mouse.Target ~= nil and mouse.Target.Parent.Name == "Items" then
	local distance = (player.Character.HumanoidRootPart.Position - mouse.Target.Position).magnitude
	if distance <= 5 then
		for _,v in pairs(guns) do
			if v.Name == mouse.Target.Name then
				givetoolevent:FireServer(v)
			end
		end
	end
end
end)
3 Likes

local guns = game.ReplicatedStorage.Guns:GetChildren()

replicatedstorage

none of the scripts run, its just a handle at this point, whereas if i keep the tool in starterpack it runs perfectly.

Try disabling all the scripts, then re-enable them after you set the clone’s parent to the backpack. This worked with my DEMO, so unless you are doing something different it should work.

The reason this works is because local scripts only run as a descendant of a player, so they try to run originally and can’t. Enabling them when they can run works around this problem.

2 Likes

Local scripts will still run in a player’s character. The fact that local scripts can not run under the workspace is simply false. Take for example, the default animate script. It’s a local script, and it runs.

2 Likes

Still doesn’t seem to work… It’s only one script also so I have no idea why its doing it.

1 Like