How do I reference/get a tool that a character is holding?

You can write your topic however you want, but you need to answer these questions:
So basically, I’ve been trying to reference a tool just by doing something like

Character.Sword

or

Character:WaitForChild("Tool")

to reference a tool a player has equipped, but this doesn’t work.

I’ve looked into this topic and so far I haven’t found anything very helpful. Someone did mention Tool.Equipped but I’m not sure if this would help.

So that’s my simple question; How do I reference a tool that the player has equipped and is parented to the character?

2 Likes
character:FindFirstChildOfClass("Tool")

If there is a tool in the character then it is equipped. I also used :FindFirstChildOfClass to find an instance by its class name as opposed to name

3 Likes

and then could I go further and name the specific tool like

local tool = character:FindFirstChildOfCLass("Tool")
if tool.Name = Sword then
--whatever
end

?

1 Like

Sure, but you will want to check if the tool is there by doing if tool then

1 Like

ok, thanks for the help and the speedy reply

1 Like