Hello! I have a problem and I don’t know how to solve it. Here is the problem.
There are two parts: Part0 and Part1.
I can detect when Part0 touch Part1 or when Part0 no longer touch the Part1 but Part1 can be destroyed and I don’t know how to detect if Part0 touch Part1 then Part1 is destroyed.
This is hard to explain. If you didn’t understood. Please say me where you didn’t understood.
local Part0 = --part0
local Part1 = --part1
Part1.Touched:Connect(function(part)
--sorry i dont know how to use indents
if part == Part0 then
Part1:Destroy()
end
end)
This should work. It connects a touched event for Part1 to a function and then when it fires then it checks if the part that touched it is Part0. If it is, then Part1 gets destroyed.
I don’t understand. Do you want it so if Part1 stops touching Part0 you want it to be destroyed? Or do you want it to detect it when it gets destroyed? If you want to detect it when it gets destroyed I just recommend anchoring the part, setting transparency to 1 and CanCollide false so you can still detect it as otherwise it is impossible.
I want to when Part0 touch Part1 then Part1 gets destroyed Part0 receive an event and do a ramdom function (So in the answer, there must not are a function.).