Yo, so I’m making a FNaF game right now and I’m planning on using coroutines for the nights because I heard they are pretty useful and I have some questions for it.
I’m planning a system where I would have module scripts for each enemy in a folder where I would require them in the main script and have a function where they would activate when the player starts the night. My problem is that I want it so that whenever the animatronic kills the player at night, I want the main script to recognize that and cancel all the other enemy script and exit the coroutines and then start a game over function, but as a noob with coroutines I cannot achieve this
My script structure is sort of like this:
Player fires remote event to start game
Server starts game and functions all the modules for enemy
I need help with this part, where if a single enemy kills the player, it breaks from the loop