How do I get player to hold a tool?

The tool model I have is a bunch of parts grouped together and a Handle. When the player holds the tool, it shows the tool and teleports them to the place where I built it. When I make the parts unanchored, it just makes the player hold on to the handle while it shows the rest of the tool fall apart and die where I built it. How can I get the tool to stick to the player’s hand?

1 Like

Hello. For that, you will have to well all of the parts together. Select all the parts, go to model tab, and you should find a button to create constraint in the constraints section. Click the drop down button and select weld constraint.

1 Like

See if all is really unchored and if isnt exist welds on anchored parts.

you may need to weld the tool in order to prevent it

Do I have to click on every individual part in the physical editor?

You can hold Ctrl and select from the explorer or you can run a macro on the run command line.

1 Like


Please help! I honestly don’t know anything about creating welds.

Run this in the command line

local Model = --Model Directory
local Handle = --Handle Directory

for _, v in pairs(Model:GetDescendants()) do
    if v:IsA("BasePart") then
        local Weld = Instance.new("WeldConstraint",v)
        Weld.Part0 = v
        Weld.Part1 = Handle
    end
end
2 Likes

I put a script inside of the tool, and pasted that code in. I added the Model directory and Handle directory. The script didn’t do anything but it didn’t print any errors.

Run it in the command line in studio

2 Likes

It is either visible at the very bottom of the window, or you can turn it on in view tab.

2 Likes

I did that and it said Line 1: attempt to index nil with parent

I directed the model using “script.Parent.Cupcake” but I guess the model or script doesn’t exist?

If you run it in the command line it would start of with workspace.

You will have to use the actual hierarchy with respect to the DataModel in the run command line.

Oh wait. I used “print()” and turns out the script didn’t run at all.

The tool is located in replicated storage by the way, when the game starts it just clones it into the player’s backpack

Could be starter pack, or ServerStorage or ReplicatedStorage too.

Step 1. Copy the script and put the directories according to the hiearchy you have.

It would look something like this
(workspace.CupcakeModel)

Step 2. Put the script in the command bar in studio

Step 3. Run the code

I already did do that, and it returned an error.

I found out the problem is that the actual script in the replicated storage doesn’t run at all.

Can you send me a screenshot of how you do it?

image
This is where the script is located

image
Here is what’s inside the script (Doesn’t run)