Module script still active after character died and respawned

So I’ve been having this problem for the past 3 hours but before that problem happened it was all working fine
Problem is that after the character dies the module script is still running, that module script is parented to the character because it’s in startercharacterscripts.
And also when character dies its a completely new character right? because the script in it is
re-initialiazing
I debugged it and it printed the script.parent of the module so it gave me my character name but something was off the first one was firing on the Client specifically on the module(I could click on the module and get to the line of code of where is it printing) while the other one was printing from the studio(this one was weird it didnt even put me in the module) but it didnt print any module beside it.
I even destroyed the module after the character died but somehow it’s still printing

Try parenting the module to StarterPlayerScripts

1 Like

It can work but obviously I need to adopt it to player scripts :>
actually its more work i have to disconnect it now everytime I change my class
earlier I didnt have to disconnect or even destroy
Still I dont understand what causes this problem it was working fine earlier.

What are you trying to do with the module exactly? Listen to when the player dies?

Actually now that I think about it the problem was happening the whole time i just didnt notice it because i didnt triggered a certain function that would warn me about the problem.

1 Like

I guess the only fix is to disable all the event and unbind it. It doesnt even matter if it’s in playerscripts or characterscripts