Deleting a part with a tool on proximity prompt

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? İ wanna make a tape that will be deleted if a player has a tool

  2. **What is the issue?**İt just does not work

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

script.Parent.ProximityPrompt.Triggered:Connect(function(player)
	local tool = player.Character:FindFirstChild("shears")
	if tool then
		script.Parent.ProximityPrompt:Destroy()
		tool:Destroy()
		script.Parent.Sound:Play()
		wait(0.5)
		script.Parent.Decal1.Color3 = Color3.new(1, 1, 1)
		script.Parent.Decal2.Color3 = Color3.new(1, 1, 1)
		script.Parent.Parent.Parent.CanCollide = false
	else if not tool then
			local tool2 = player.Backpack:FindFirstChild("shears")
			if tool2 then
				script.Parent.ProximityPrompt:Destroy()
				tool2:Destroy()
				script.Parent.Sound:Play()
				wait(0.5)
				script.Parent.Decal1.Color3 = Color3.new(1, 1, 1)
				script.Parent.Decal2.Color3 = Color3.new(1, 1, 1)
				script.Parent.CanCollide = false
			else if not tool or tool2 then
				end
			end
		end
	end
end)

and also tried this script

game.Workpsace.CautionTape.PPPart.PromptButtonHoldBegan
	if unlock then
		if unlock.Character:FindFirstChild("shears") then

			script.Parent.PromptButtonHoldEnded:Connect(function()
			end)
		end
	end
end)
script.Parent.Triggered:Connect(function(unlock)
	if unlock then
		if unlock.Character:FindFirstChild("shears") then
			wait(0.03)
			script.Parent.Parent.Parent.Sound:Play()
			script.Parent.Parent.Parent.Parent.Hidden.Script.Enabled = true
			unlock.Character:FindFirstChild("shears"):Destroy()
			script.Parent.Parent.CanCollide = false
			script.Parent.Parent.Anchored = false
			script.Parent.Enabled = false
		end
	end
end)

Could you explain what is not working exactly? For example, do you get any errors?

This part is also pretty pointless.

What are you trying to accomplish? Is it similar to when you use a key on a door, the door disappears?

Yes i want something similar to that

script.Parent.ProximityPrompt.Triggered:Connect(function(player)
	local tool = player.Character:WaitForChildChild("shears")
		script.Parent.ProximityPrompt:Destroy()
		tool:Destroy()
		script.Parent.Sound:Play()
		wait(0.5)
		script.Parent.Decal1.Color3 = Color3.new(1, 1, 1)
		script.Parent.Decal2.Color3 = Color3.new(1, 1, 1)
		script.Parent.Parent.Parent.CanCollide = false
	else if not tool then
			local tool2 = player.Backpack:FindFirstChild("shears")
			if tool2 then
				script.Parent.ProximityPrompt:Destroy()
				tool2:Destroy()
				script.Parent.Sound:Play()
				wait(0.5)
				script.Parent.Decal1.Color3 = Color3.new(1, 1, 1)
				script.Parent.Decal2.Color3 = Color3.new(1, 1, 1)
				script.Parent.CanCollide = false
			end
		end
end)

This basically yields until tool is find, if tool isn’t there, it’ll show error so you get idea that exactly what’s happening.

The error is attempt to call a nil value

On which line ?
[Characterssss]

İts on client also i have this script

local pp = script.Parent.PPPart.ProximityPrompt

pp.Triggered:Connect(function()
	script.Parent:Destroy()
end)

but i cant Modify it to work with a part