From what I’ve seen, scripts with the runcontext set to local work the exact same as local scripts, only decompilers cant read them because their classtype is a script. If that’s the case, then wouldn’t I be able to change all my local scripts to scripts with local runcontext to protect my scripts better?
The difference between a LocalScript and a Script with RunContext of Enum.RunContext.Client has nothing to do with security. Instead, this property addresses a paradigm related to Starter containers (ex. StarterGui, StarterPack, etc.).
For a LocalScript example, consider a Tool located under StarterPack. It will not execute its code until being cloned into a LocalPlayer’s Backpack. This prevents having to write boilerplate code to either wait for the LocalScript (or actually a clone of it) to be in a container relevant to a client or enabling a clone of an initially disabled LocalScript from the server. In this case a LocalScript will not act the same as a Script using RunContext.Client as the Script will run (on the client) when the Tool is still a child of StarterPack and then it’s clone will also run when the Tool is a child of the Player’s Backpack.
An example of where a RunContext.Legacy Script acts differently than a RunContext.Server Script is ServerStorage. The Legacy Script will not run in ServerStorage, while the Server Script will. Additionally a RunContext.Client Script will never run in ServerStorage because descendants of ServerStorage are never replicated to clients.
You forgot one more crucial point about Enum.RunContext.Client:
These types of scripts dont just run on a singular client… no no no
These types of client scripts will RUN on EVERY CLIENT that has it replicated.
So it just means if you have one of these types of scripts lets say parented to workspace or someone’s character, it’ll also run for you too and even the other clients.
It’s basically the definitation of a server script except all the changes are done clientsided.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.