Tool is not attaching to the character's hand

I am making a custom hotbar system. I have a script that when you click a button, you equip a tool. It works however, the tool is not attached the the players hand and just drops.

This is the script in my button.
Screen Shot 2020-06-18 at 12.41.57

Here is the tool and its properties.
Screen Shot 2020-06-18 at 12.50.39
Screen Shot 2020-06-18 at 12.50.46

If anyone knows how to fix this please let me know.

Thanks.

2 Likes

I would try unanchoring the Tool and making it so the part inside the tool is named ‘Handle’. As well as this, if you are using a local script for the button, only the client will be able to see the tool. So try using a RemoteEvent.

The part inside the tool is named “Handle” and its unanchored. I might try using a remote event and see if it does anything.

I’m not sure if this is what you wanted, but I made it so it clones into your inventory. The only problem with this is it is not equipped straight away. The player will have to equip it themselves.


This is the script:
image

1 Like

If you want to place it into the players hand automatically, just do:

tool.Parent = player.Character

This will make the player equip it, since when it is equipped, it is in their character.

6 Likes

I tried equipping it straight to the character, then it makes you equip it straight away, but the tool does not appear. I think the problem is you are running the script in a local script when it needs to be run in a script.

1 Like

Thank you so much guys. I have figured out how to fix my issue. I used a remote event and just cloned the tool into the character and it works. Both of you helped me so much thanks!

1 Like