How to use a tool to delete a certain part?

Yep. Just like that, workspace has StoneDoor and starterpack has sledgehammer

Show us your script please, i need to post 3x10 chars atleast

repro.rbxm (3.3 KB)

Here’s the tool file.

Quick Question, how do you make files like that?

local tool = script.Parent

local event = tool.OnActivated

local door = workspace.StoneDoor

event.OnServerEvent:Connect(function()
	tool.Head.Touched:Connect(function(plr, Hit)
		if Hit == door then
			Hit:Destroy() 
		else
			print("not the part")
		end
	end)
end)

local script:

local player = game.Players.LocalPlayer

local tool = script.Parent

tool.Equipped:Connect(function()
	tool.Handle.Anchored = false
	tool.Head.Anchored = false
end)

tool.Activated:Connect(function()
	local event = tool.OnActivated
	event:FireServer()
end)

Right click and “Save to File…” in studio.

1 Like
tool.Head.Touched:Connect(function(plr, Hit)

Get rid of “plr”, “Touched” only has 1 parameter (which represents the hit BasePart).

I’ve tried it before, and I tried it again, still didnt work :frowning:

I’d recommend just using the tool I provided, since it works.

I cant open it. Its just a blank file for some reason

You need to drag and drop it into studio.

1 Like

Oh it worked… I just had to make the tool just 1 part and it worked. Thanks a lot man