My tool won't work when cloned from ReplicatedStorage

I want to make my tool work

I am cloning it from the server via. RemoteEvent, but when I do so the tool won’t work.

Devforum

I am using a localscript in my tool and it fire’s an event to make the player grab but when doing so the print functions don’t work. It clones the tool into the player from the server so that isn’t that problem. I have the Script which is in ServerScriptService that checks if the event has been fired from the client. And the LocalScript is in the tool.

-- LOCAL SCRIPT
script.Parent.Activated:Connect(function()
	print("Tool Used")
	if script.Parent.Parent:FindFirstChild("Humanoid") then
		print("Humanoid Found")
		local animation = script:WaitForChild("Grab")
		local animationTrack = script.Parent.Parent:FindFirstChild("Humanoid"):LoadAnimation(animation)
		animationTrack:Play()
		game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent"):FireServer()
	end
end)

-- SERVER SCRIPT 
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(player)
	print("RUNNING")
	rayTest(player)
end)

--SERVER SCRIPT THAT ADDS TOOL
game.ReplicatedStorage.GiveTools.OnServerEvent:Connect(function(player,tool)
	for i,v in pairs(game.ReplicatedStorage:WaitForChild("TransfurCosmetics"):WaitForChild(tool):WaitForChild("Tools"):GetChildren()) do
		v:Clone().Parent = player.Backpack
	end
end)

Hello, judging by the “Activated” event on line 1 of the local script, are you using a HopperBin or a Tool?

Edit: I’m also noticing that in the code you sent, there doesn’t seem to be anywhere where the RemoteEvent called “GiveTools” is being fired.

I am using a Tool I know HopperBin’s are depracted

Oh I didn’t add the code for that but when I get infected it does give me the tool.

Never mind, I figured out why. I am so dumb I forgot to put Requires Handle to false :laughing:

1 Like