How to run a module function without having to wait every time for it to finish

  1. I want to have a ModuleScript’s function run overlapping each other (so multiple of the same function can run at once instead of waiting for a long time.

Spawn code (I know it’s messy and with while loops, I’m using it to test if a player is notified more than one time).

spawn(function()
	while wait(0.2) do
		NotificationModule.Notify("This feature is a work in progress!")
	end
end)

Please help, thanks!

You can use the spawn function inside the module instead.

I’m a little confused. Do you mean something like:

module.Notify = spawn(function() end)?```

No no, like in the actual module’s function code.

Ok, I’ll try it out and let you know if it’s not working out. Thanks!

1 Like