Resetting a local script outside of starterplayer

I am trying to reset a script that’s outside of starterplayer, as the title says.

The point of the script is for firing bullets, and it stops working after the player dies.

I’ve tried using CharacterAdded, but I’m pretty sure it does not work outside of starterplayer.

Is there another way to reset the script?

Edit: The script is in replicated storage.

When you say it’s outside of starterplayer, where actually is the local script located?

my guess is some connections are tied to the previous character, so maybe reconnect those if they are.

oh, i forgot to add that to the post, its in replicatedstorage.

thats probably why its not working, but i still cant detect when the character respawns, so i dont know when to reconnect them.

Can you send a photo of the script?

local resetScript = "Your Script"

local function resetScriptFunction()

resetScript.Enabled = false
resetScript.Enabled = true

end)

resetScriptFunction()

why not just put the script inside of characterScripts?