local part = Instance.new("Part")
part.Parent = workspace
task.spawn(function()
wait(1)
part:Destroy()
end)
script:Destroy()
Normally, the part would wait a second, then destroy itself, and then the script would be destroyed.
But, with task.spawn, the script will be destroyed immediately.
My question is:
Would the part be destroyed? On the one hand, the script is technically destroyed before it can execute that (because of the task.spawn), but on the other hand maybe task.spawn guarantees that function will be run no matter what, since it’s kind of separate?
I’m tryna use instancing to make a body velocity for knockback
but the script is part of the projectile
and i want the projectile to destroy itself when it hits
but there needs to be some delay on the body velocity before its destroyed
but obviously since the script, which is part of the projectile, will be destroyed
so i cant destroy it in there
and i was hoping task.spawn might help my issue