How to know what tool has is the player equipping right now

to keep this in perspective,
how do you know when the player is equipping a tool and recognizing its name and properties etc. because there is only a property of the player which is the backpack that contains all the items in the backpack

Now i want to know how can you recognize the tool and its properties while they are equipping it without using an event called Equipped on the tool

You could probably search in the player or character’s descendants and find if an instance is a “tool”, for example like this.

local player = game:GetService('Players').LocalPlayer

for i, v in pairs(player.Backpack:GetDescendants()) do
if v:IsA('Tool') then
--blah blah do anything about the tool
end
end

or this one but in a character model.

local player = game:GetService('Players').LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()

for i, v in pairs(char:GetDescendants()) do
if v:IsA('Tool') then
--whatever blah blah anything
end
end

Edit: These examples i gave to you can only work in localscripts but i’m sure you’ll find a way on how to search it in a public script (not a module).

When someone equips a tool, the tool parent switches to the player’s character.

1 Like