My part do not destroy if she isn't in a table

Hello, i will know why i can’t destroy my part if she isn’t in a table,
this is the script:

local hasTouched = false
local TweenService = game:GetService("TweenService")
local launchRemote = game.ReplicatedStorage.Fruits["Tori Tori no mi"]:WaitForChild("LaunchEffects")
local tweenInfo = TweenInfo.new(
	2,
	Enum.EasingStyle.Cubic,
	Enum.EasingDirection.InOut,
	0,
	false,
	0
)

launchRemote.Event:Connect(function()
	local check = workspace:FindPartsInRegion3(Region3.new(script.Parent.Position - (0.5 * script.Parent.Size), script.Parent.Position + (0.5 * script.Parent.Size)), script.Parent)
	script.Parent.Size = Vector3.new(0.05,0.05,0.05)
	script.Parent.Transparency = 0
	
	if not check then
		print("Destroying the part", script.Parent.Name)
		script.Parent:Destroy()
		return
	end	
	
	for i, v in pairs(check) do
		print(script.Parent.Name, v)
	end
	
	check = check[1]
	
	
	
	
	script.Parent.Color = check.Color
	script.Parent.Material = check.Material
	
	local playTween = TweenService:Create(script.Parent, tweenInfo, {Size = Vector3.new(4,4,4)})
	playTween:Play()
	wait(8)
	local secondTween = TweenService:Create(script.Parent, tweenInfo, {Size = Vector3.new(0.05,0.05,0.05)})
	secondTween:Play()
	wait(2)
	script.Parent:Destroy()
end)

There is no such event launchRemote.Event, change it to launchRemote.OnServerEvent.

No, it’s with a bindable event, the script work but the destroy doesn’t work

1 Like

:warning: It’s with a BindableEvent, so it’s with a .Event :warning:

Do you get any errors in the output?

No error in the script
image