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

Why is my tool not going in the backpack inventory?

Basically, my tool isn't equipping right and i made a script for it.

script.Parent.Parent.Equipped:Connect(function()
	local player = game.Players.LocalPlayer
	local tool = script.Parent.Parent:Clone()
	tool.Parent = player.Backpack
end)

No errors. I checked the backpack and saw nothing was there. Am I doing something wrong?

7 comments

0

Is the event firing properly? Put a print in there and see if it fires.

0

k

0

... i added a print and it made an error. "Equipped is not a valid member of Backpack "Players.xBenDaii.Backpack"

0

woops, i didnt put the model in the tool, still doesnt work in the tool though

1

Are you going too far back? It seems like you are indexing the backpack instead of the tool, try removing one of the ".parents".

0

Are you sure that "script.Parent.Parent" is referring to the tool?

0

yes

1 answer

May or may not fix issues for you:

script.Parent.Parent.Equipped:Connect(function()
2	    local player = game.Players.LocalPlayer
3	    local tool = script.Parent.Parent
4	    tool:Clone().Parent = player.Backpack
5	end)

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