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

How to check slot of tool in backpack?

I am developing a backpack managing script, and I'd like to know how how to check the slot of a tool. Obviously, I can check the order they appear in, but that won't include the tool currently being held or any gaps, therefore giving me incorrect answers.

Is there a function or property I can use? So far I have found none on the wiki, on both the tool and backpack pages.

2 comments

0

:GetChildren if you want to get the children of the backpack. But i'm not quite sure what you mean, sorry.

0

Not sure what you mean, but try to use for loop like:

2 answers

Asked this in the discord, apparently, you cannot check it. If you're trying to do this, you're going to have to make a custom backpack system.

Not sure what you mean but you can try using for loop

game.Players.PlayerAdded:Connect(function(plr)
for i,v in pairs (plr.Backpack:GetCHildren()) do
if v:IsA("Tool") then
 -- Code here
end
end
end)

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