NOTE - This is a re-post/duplicate question to this here. Though it didn't get much of a response, (since I posted it @ 2:00 in the morning) so I'm asking this again.
I was wondering this as I wanted a more precise solution to yielding a thread. Consider this:
Instead of doing this
local conditional
spawn(function()
repeat wait() until conditional
--do stuff
end)
wait(1)
conditional = true
One could do this:
local conditional = Instance.new("BindableEvent")
spawn(function()
conditional.Event:Wait()
--do stuff
end)
wait(1)
conditional:Fire()
Though wan't fully sure if an instance not parented to the DataModel would automaticly despawn and get removed after awhile.

7 comments
Don't duplicate a question.
Well it didn't garner much of a response in the first place. Should I turn to the forums instead?
I believe the garbage collector won't pick up something as long as something else still references it
You could just do conditional:Destroy() in the do stuff area.
conditional.Event:Wait()Why not set up a function instead of using a coroutine?https://devforum.roblox.com/t/psa-connections-can-memory-leak-instances/90082
Ah I see. I knew that connections to an instance wouldn't be broken until the object was destroyed or disconnected, though I just wanted to confirm that a referenced Instance that isn't parented to the datamodel wouldn't despawn or something.