A question about threads

I have been learning about delay() and threads recently and my basic understanding is that they are essentially running a piece of code while more pieces of code are being run at the same time. My main question is , do events like .Touched or .PlayerAdded create new threads because I notice that even when I have a while loop in my function , more events are still able to fire.

Yes, when you are connecting a connection to a function you are basically creating a new thread

2 Likes

They do, although I wouldn’t say they execute at exactly the same time (I don’t think Roblox pushed out parallel threading yet)

The task scheduler (which determines when different types of actions should execute) handles event executions at a given time per-frame.

1 Like

Thanks for the information guys.

1 Like