I’ve made a TERRIBLE mistake where a Gui script contains a LocalScript in which holds a bunch of help module scripts, I’m almost done with my game, but haven’t tested dying up until now. I’ve noticed that after death, the module scripts fire twice, and then fires 3x after the third death and so on.
The LocalScript is under a ScreenGui that resets upon death. Simply making it not reset upon death breaks everything. I preferably do not want to restart my scripts all over again as I’ve made thousands of lines of work already.
Below is an example of a module script holding 2 errors after the third death:
Presumably from the 2 previous character lives where they still function and respond to such as User Inputs.
This of course is not ideal, but I am too deep into this game to change it all, I understand now what I did is a mistake, but is there a way to almost cancel or unrequire module scripts?
Sound is most definitely a part of the modules script, I’ve noticed that this behaviour occurs when scripts are destroyed but they are still functioning and you attempt to call a child of it.
Because a lot of my variables are defined at the start of the script, for example Humanoid etc.
I’ve tried that, it’s because it’s under a local script that gets destroyed as the GUI resets upon spawning. Meaning all the module scripts under it are destroyed, I’ve tested it by having a random number be printed when this function is used, and the previous number along with the most recent number is being outputted indicating that the module script is still functioning despite being destroyed.