New Spawn() function?

I was just doing some scripting, and I noticed a new capitalized Spawn() function. Does anybody know the behavior of this new function? Or is it just the same?

1 Like

Don’t think that’s new, it’s a PascalCase version of spawn(). Don’t use either of those, use task.spawn instead. That’s the new way to spawn threads.

1 Like

Pretty sure it is the same, but Spawn() is like a typo of spawn(), so no difference.

I know I know this information but mind explaining it again to the OP and myself?

Some Roblox API (globals, properties and methods) have old spellings or capitalisations that get deprecated for a more standardised version (e.g. most camelCase methods get deprecated in favour of PascalCase - compare connect and Connect). Spawn’s the same way.

task.spawn was released along with the rest of the task library as a more modern way of working with threads. It’s not bound to any legacy pipelines and allows you to directly interface with the scheduler as well as prepare for deferred signals being the standard for Roblox coding in the future. More information is available on the task library announcement.

Just on another note, you might notice Delay exists and has keyword highlighting like delay does. They’re the same function internally, just with differing capitalisations.

1 Like