Module Script Function stopping when player dies

So I have a problem, I made a function in a module script and the argument of the function is the player activating it, but when the player dies, the functions stops.
And so the main problem here is that the effect is that when the player dies, the script stop and then the effect is still there, i think the same problem happens too if the player left but didn’t tested in multiplayer.

1 Like

Also I Think Because When The Player Dies His Character Get Destroyed For Some Seconds, So I Think You Have To Make while wait() do check

Uhm anyway I think Imma just do an event that removes the effect when the player dies/leaves.