I'm trying to make a script where if the Pike Pole touches the part it removes.
But I have multiple of them in the game. So I don't want all the parts named "Glass" to remove
local part = script.Parent part.Touched:connect(function(hit) if hit.Parent then local pike = hit.Parent:FindFirstChild("Pike Pole") if pike then script.Parent.Glass:remove() end end end)
it worked when I did game.Workspace.Glass:remove()
though
You are trying to find a object named glass inside of the glass part, so it'll never work.
local part = script.Parent -- The glass part.Touched:connect(function(hit) if hit.Parent then local pike = hit.Parent:FindFirstChild("Pike Pole") if pike then part:Destroy() -- Kill glass end end end)