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

How do I clone a tool into a players backpack? [Solved]

I'm trying to clone a tool from ReplicatedStorage into a players backpack with a command

when I type the command in the script runs through but the receiving player doesn't get the tool.

Here is the script:

commands.give = function(sender, arguments)
	
	print("Give Classup command fired by "..sender.Name) 
	
	local playerToGiveClassupTo = arguments[1]
	local toolToGiveToPlayer = arguments[2]
	
	if playerToGiveClassupTo then
		local plr = findPlayer(playerToGiveClassupTo)
		
		if plr then 
			local backpack = plr:WaitForChild("Backpack")
			local cloneTool = game.ReplicatedStorage.classup:Clone()
			
			cloneTool = plr.Backpack
			print(playerToGiveClassupTo.." was given ".. toolToGiveToPlayer) 
				
		end
	end
end


there aren't any errors in the output but no tool is in my inventory.

the command is ":give (Player name) classup" and the tool "classup" is in ReplicatedStorage.

any solutions?

edit: also this is just a section of the script showing this command only. all my other command scripts work fine.

1 answer

sorry for the inconvenience, I just solved it by adding a parent to the tool line.

here for anyone who had the same problem:

cloneTool.Parent = plr.Backpack

1 comment

0

No inconvenience created, you're fine :)

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