I have this main module that I’m working on. However, the only problem is the local script keeps on getting destroyed when the client respawns/resets. This affects the first people who joined in a new server. There’s nothing wrong for new players since this local script is parented to ReplicatedFirst and so it stays on them forever.
If you put a local script inside Player-PlayerScripts it will not be re-run when the character is destroyed since the player does not disappear until the user leaves the game.
So if you parent a local script to StarterPlayerScripts, it will only run once when the player first joins the game.
Does this help you out?
Unfortunately keeping a local script running between servers is not possible, if this is what you were trying to do.
ReplicatedFirst only runs once, put that script in
StarterPlayer > StarterPlayerScripts as suggested before, or if it’s a GUI, inside a GUI. It would still work.
So Im planning to make this local script work for existing players. I’m going to parent the local scripts inside the gui, only to those first players in the server. However, this won’t affect to people who join after them.