So i’ve been looking into this and trying to figure this out, but I can’t seem to. Basically I want to destroy a part with a certain name LOCALLY if the tool in your hand detects the part is the part you’re looking for.
This is a local script in the tool’s handle
local gl2 = game.Workspace.Folder.GlassShatter2
local function onPartTouched(gl2)
gl2.Glass:Play()
wait(1)
gl2:Destroy()
end
Once again, you forgot to connect a touch event. At the end of your code, add this:
script.Parent.Touched:Connect(onPartTouch)
However, this will destroy any part it touched because you never check if it’s a specific part.
Change your code to this:
local gl2 = game.Workspace.Folder.GlassShatter2
local function onPartTouched(hit)
if hit ~= gl2 then return end
gl2.Glass:Play()
wait(1)
gl2:Destroy()
end
script.parent.touched:Connect(onPartTouch)