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

How can I know the name of tools in a backpack ?

Hi, I'm working on a project that requires to know the name of tools in a local player's backpack. How can i get the name of those tools? Like can i form a table? Please help me!

1 comment

0

this is not a script request site

2 answers

Put a LocalScript in the StarterGui:

wait()
local player = game.Players.LocalPlayer
local backpack = player.Backpack

for i,v in pairs(backpack:GetChildren()) do
       print(backpack:GetChildren()[i].Name) -- OR
       print(v.Name)
end


Keep in mind this is not tested, and it might not work. Hope this helps!! :D

you can loop through the backpack to find all the tools like this

local player = game.Players.LocalPlayer
local backpack = player:WaitForChild("Backpack")

for _,v in pairs(backpack:GetChildren()) do
	 -- if v:IsA("Tool") then -- If you want only tools
	print(v.Name)
end

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