Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Cloning tools into players doesn't work?

I have a script that clones tools into player's backpacks but the tools are not functioning, I can hold them just find but things like animations don't play, here is the code I am using to clone the tools:

Variables :

local item = script.Parent.Parent
local Rep = game:GetService("ReplicatedStorage")
local toolCloneReplicated = Rep:WaitForChild("IngameItems")
local tool = item:FindFirstChildOfClass("Tool")

Cloning Code:

		local toolName = tool.Name
		print("Looking for "..toolName)
		if toolCloneReplicated:FindFirstChild(toolName) then
			local toolFind = toolCloneReplicated:FindFirstChild(toolName)
			print("Found")
			local toolCloneToBackpack = toolFind:Clone()
			toolCloneToBackpack.Parent = backpack
		end
	end

EDIT : I might have a fix for this that uses a Remote Event as it is being moved by the client and the animations and damage are server scripts, if anyone could confirm or deny this that would be great.

1 answer

you never defined "backpack" line 7. Also there is an extra end in the cloning code.

4 comments

0

This is because there is more to this script and this is just a portiion of it, backpack is "player:FindFirstChildOfClass("Backpack") " and I get the tool fine, it just doesn't work

0

backpack is not a class. it should be :FindFirstChild("Backpack")

0

backpack is not a class. it should be :FindFirstChild("Backpack")

0

backpack is not a class. it should be :FindFirstChild("Backpack")

This discussion is preserved as it was. New answers, comments, and votes are closed.