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

How do I check if a player is holding a tool and select tools for them?

I want to make a player unable to not have a tool selected. Is there a way for me to check whether they have a tool selected and/or force select a tool for them?

1 answer

✓ Accepted answer

If I'm hearing you correctly, you want to check if a tool is selected?

There is a Selected event for tools. You can add it to your connection lines for functions. For example:

tool.Selected:connect(function()
-- 'tool' is just a variable I came up with. Don't use the variable 'tool' if it's not stated.

The following is like any ordinary connection line, and this one checks if the tool is selected.

On activation (clicking with a tool)

Somewhat similar to the Selected event, this checks if a tool was clicked, not selected.

Also can be added to connection lines. For example:

tool.Selected:connect(function()
-- 'tool' is just a variable I came up with. Don't use the variable 'tool' if it's not stated.

Please upvote and accept my answer! Thanks!

1 comment

0

Great, thanks. Is there a way to force select a tool for a player?

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