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

Where does an item go when the player is holding it and how to locate it?

This is a script that takes the items in the player's backpack and puts the names of those things into the table things as a string. My problem is that when the player is holding an item, the item disappears from their backpack which means that it wont be located by the for loop. How could i modify this so that if they are holding an item, it finds it as well?

local things = {}

for _, v in pairs (player:GetChildren("Backpack")) do
	things[v.Name] = v.Name
end

1 comment

0

I believe you could use ChildAdded for this, unless that is not what you're trying to do.

2 answers

✓ Accepted answer

When they are holding it, it goes into the players character. To get the tool and it's info use:

local tool = player.Character:FindFirstChildWhichIsA('Tool')

-Ducky

Developer

Youtuber

When they are holding it, it goes into the players character. Use player.Character:FindFirstChild("ToolName") for this.

1 comment

0

The problem with this is that I do not know the tool they are holding

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