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

Is there a way to know which tool the player currently is "Equipping" without using .Equipped ?

Is there a way to know which tool the player currently is "Equipping" without using .Equipped ?

I have tried a lot of things.

I have searched the wiki too, but without any luck

I am not asking for anyone to create a script for me, I just want to know how I would do this.

Any help is greatly appreciated!

3 comments

0

why in the world wouldn't you use equipped?

0

I have my reasons. Because I am making a system that "deposits" the tool you're holding, when you click a button. And if I used Equipped, it would deposit when I Equipped the tool, not when I clicked the button. That's why. I have tried implementing the clicked event inside the equipped event, but that did not work.

0

You didn't specified what .Equipped is from. AFAIK that's an event for tools, so you are saying you have a lot of tools connected to the same function? Just connect them to different functions.

1 answer

✓ Accepted answer

You could iterate through the player's character, and find any "Tool" instance. Alternatively, you can use "FindFirstChildOfClass" to find the first "Tool" instance, since you cannot equip multiple tools at once. Note that this will not work for the older "HopperBin" tools.

-- The following is untested code
local Player = game.Players.XXXX
local Character = Player.Character
function GetTool()
	return Character:FindFirstChildOfClass("Tool")
end

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