How to make a part dissapear for ONLY the player touching it?

  1. What do you want to achieve?
    I am trying to make a part remove after a local player has touched it.

  2. What is the issue?
    The problem is that the part removes for all players after being touched by only one. How would I make this part only remove for the person touching it?

  3. What solutions have you tried so far?
    I’ve tried putting the code in a local script, but that does not seem to work. I’ve also tried using RemoteEvents.

I am really new when it comes to scripting, so please bear with me.

This is the current code im working with

function touch()
	wait(0.3)
	script.Parent:remove()
end 

script.Parent.Touched:connect(touch)

Replace remove() with :Destroy() and make sure it has a capital d because it’s case sensitive.

Have you tried using using :Destroy() instead of :remove()? :remove() is depricated i believe.

local part = script.Parent
local plr = game.Players.LocalPlayer
part.Touched:Connect(function(hit)
      if hit.Parent.Name == plr.Name then
          part:Destroy()
      end
end)