Anchoring Problem

Hey, so I was wondering how would I make a tool that when touches a part it makes it unanchored. I have been trying to wrap my head around some time now and I can’t really find anything on Youtube or Devforum, any help is appreciated.

You can use the Touched event for that!

1 Like

I have tried using a .Touched event but it doesn’t really seem to work, or atleast my variant of code.

Hm, could we see the script then? You probably mistyped something

Follow the steps:

  1. insert script in your part

  2. Make a touched event in the script

  3. Check if the player is equipped with the tool

  4. unanchor the part

local part = script.Parent -- Place this script directly inside the part the tool will touch.

part.Touched:Connect(function(hit) -- Checks if something is touching it
    if hit:FindFirstAncestorWhichIsA("Tool") then -- Checks if the thing touching it is the child of a tool
       if hit:FindFirstAncestorWhichIsA("Tool").Name = "Your Tool's Name" -- Checks if it's the correct tool
           part.Anchored = false
        end
    end
end)