Local scripts locations

Hi guys,

I am trying to create something like minigames in my game, so I have main server script in ServerScriptService then I am trying to communicate it with clients by RemoteEvents and RemoteFunctions exceptionally but sometimes happes to me my local scripts are destroyed due to my character was killed and my localScript was in PlayerGui. Do you recommend move these scipts to StarterPlayerStarterPlayerScripts ? Or do you have some better solution for this type of problem ?

Thank you

Yes, I’d recommend putting your local scripts to starterplayerscripts. You’ll still be able to do anything that you could do when they are elsewhere, and you won’t have problems related to them being destroyed.

Edit: And it can be easier to find them when you don’t spread them to different locations (as long as you use folders to organise them, if there are many of them).

1 Like

LocalScripts can only run in one of four places (player’s backpack, player’s PlayerGUI, player’s Character or the player’s scripts), use whichever is best suited to your purpose. For this, I’d suggest StarterPlayerScripts as it won’t be deleted when the player dies.

1 Like