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

Tool not moving to backpack?

Made a code to move a tool to the players backpack if they had a specific name, it doesn't want to work.

game.Players.PlayerAdded:Connect(function(player)
	if player.Name == "TudiPYM" then
		local register = game:GetService("ServerStorage"):WaitForChild("Black Registry")
		local clone = register:Clone()
		clone.Parent = player.Backpack
	end
end)

This is a script inside of ServerScriptService.

2 comments

0

can you put a print at the start of the function? if it doesn't print, ill give an answer, if it doesnt ill try

0

and it doesn't print, so the event doesnt work, where should I put the script?

2 answers

✓ Accepted answer
clone.Parent = player.StarterGear

1 comment

0

WORKED! THANK YOU!

You can probably try this way.

game.Players.PlayerAdded:Connect(function(player)
	for i,v in next,game.Players:GetPlayers() do
		if player.Name == "TudiPYM" then
        	local register = game:GetService("ServerStorage"):WaitForChild("Black Registry")
        	local clone = register:Clone()
        	clone.Parent = player.Backpack
    		end
	end
end)

1 comment

0

Still didn't work

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