User story
As a developer, I currently have to structure my clientside game logic in awkward ways because LocalScripts can only run in select locations (backpack, character, etc). For instance, if I want to hook up a shop so it opens when players stand on a kiosk, I either have to:
Handle with Server Scripts:
I can use a script parented to the kiosk to check for when players are standing on it and ask them to pull up the shop UI. This is awful though, because the server doesn’t have enough information. There are clientside preconditions to opening the shop such as the shop not already being open, another fullscreen interface not being open, the user not being in a cutscene, etc. It’s awful when 99% of my shop logic is clientside, but the trigger to open it is server side.
Use StarterPlayerScripts:
Handling this through a LocalScript in StarterPlayerScripts is not ideal either. What if I decide to change the parent/name or remove one of the kiosks in my game? Now I have to go hunt down wherever I hooked into the kiosk in this massive amalgamation of code I’ve shoved into the Instance form of _G.
Ideal
I want to be able to decouple my game. Shared modules/services (e.g. keybinds) used by multiple components of the game would remain in global locations, but individual components would have their own logic localized. If I have a shop kiosk, it should have all its scripts within its own model so I don’t have to manually hunt down and update everything that uses it in Starter_GScripts every time I make a change.
There is also room for improvement with LocalScript <->
Script communication. Some of the endorsed models with Humanoids come together pretty nicely because they can run both scripts and localscripts within the model in a closed loop. They don’t need to pollute Starter_GScripts, ship models with instances named PutMeInStarterPlayerScripts, or require micromanagement of distant scripts every time a model is added/removed/has its parent changed. All of the logic is contained to where it’s needed.
Implementation
At one point, LocalScripts needed to be parented to these specific locations. Pre-FilteringEnabled, if LocalScripts could be run anywhere, there would have been no distinguishable difference between them and server scripts. With FilteringEnabled though, now that’s not an issue – LocalScripts and Scripts are two distinct entities. With that out of the way, there should be a way to run client code from anywhere in Workspace, similarly to what we can do with Scripts.
We can’t just switch the behavior of LocalScripts so they run anywhere, as there are bound to be large amounts of games that parent them somewhere under Workspace expecting that they won’t run. Games are not forced to use FE either, even though it’s strongly encouraged. We would need to maintain backwards compatibility and ensure LocalScripts made in one game still work in another (e.g. property/new class). It’s hard to propose good implementation for this, so I’m not going to ask for any specific behavior – the engineers will be able to make a better judgement call.