--//Script is not stored in the object directly
object.Touched:Connect(function()
object:Destroy() --//In my scenario I would like to destroy the object before continuing
--//do some stuff
end)
Is there a way I could get it so like, the function will continue running despite destroying the object?
Not sure if this is possible or not…thanks.
I’m pretty sure that the code will keep running even though the first thing it does is destroy an object. The code will still run, but the Touched event will no longer fire since the object is destroyed.
You could try to mimic the part being destroyed by setting its Transparency and CanCollide then at the end :Destroy() it. Though I would think the code would still execute ¯_(ツ)_/¯