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

Quick question... how do I define the tool that a character has equipped?

I am trying to access some tools that have different names but the child, which is an IntValue, has the same name in all of the tools. I am able to access the specific tool by using "game.Players.LocalPlayer.Character.'ToolName'" but I need to be able to get that tool without using the name. Thank you :)

2 comments

0

Like, a server script outside of the tool or a script inside of it?

0

The script is outside of the tool, yes

1 answer

✓ Accepted answer

You can use FindFirstChildOfClass() to find any Tool instance under the Character.

local tool = game.Players.LocalPlayer.Character:FindFirstChildOfClass("Tool")
if tool then
    --do stuff
end

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