How to make smooth instance:destroy()?

Hi,
i have a problem i have a npc spawn locations and i use a bool value to check if place ready to spawn new npc. and i want this place be ready if there no more npc i tryed this script:

script.Parent.TouchEnded:Connect(function(hit)
	local player = game.Players:GetPlayerFromCharacter(hit.Parent)
	if not player and hit.Parent.Name == part.Name then
		print(hit.Parent.Name)
		part.Ready.Value = true
	end
end)

but this script don’t see an npc. I noticed that script will see it if i will make npcs HumanoidRootPart anchor false. also i noticed that if i will just delete npc it will work (i deleted it when im in server mode), but if i will do a instance:Destroy() normally it will give me an error:

Screenshot_187

script.Parent.TouchEnded:Connect(function(hit)
	local player = game.Players:GetPlayerFromCharacter(hit.Parent)
	if not player and hit.Parent ~= nil and hit.Parent.Name == part.Name then
		print(hit.Parent.Name)
		part.Ready.Value = true
	end
end)

try this

still don’t work. (30 charrrrs)

Where is the variable “part” defined?

oh ye i forgot to add it in here. its script.Parent script located at part

You could use TweenService, then make the part disappaer
Example:

local tweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(1,Enum.EasingStyle.Cubic,Enum.EasingDirection.InOut,0,false,0)
local goal = {Transparency = 1, Size = Vector3.new(0,0,0)}
local tween = tweenService:Create(PartToDestroy,tweenInfo,goal)
tween:Play()
wait(1.1)
PartToDestroy:Destroy()

i don’t want to make part dissapear.
I have like 10 parts and its invisible.
This parts is spawn points for npcs
when i do npc:Destroy() i want boolvalue value change to true so my spawn npc script can spawn new npc at this place
i made this script to check if there still npc if no then value will change to true

you will have to use a RemoteEvent for that

how can i detect which part dont have npc anymore? my parts named like npc so my spawn npc script know which npc spawn in this part

if i have 10 parts i need 10 different named remoteEvents for every part. or i can detect somehow part?