LocalScripts should show the RunContext property as a readonly value in the Properties Widget

Server scripts have a visible property called RunContext that can be set to legacy, client, or server that will change how it works.
Unaware to many people, localscripts have the exact same property, but it’s hidden from the user.

They both inherit the same class BaseScript which contains this property, but localscripts are purposefully hiding this property. I would imagine due to legacy complications it needs to have this setup, but I believe it would be helpful to have this property show up as a readonly property to help communicate to the developer if it was accidentally put in an undesirable state.

By default it is set to Enum.RunContext.Legacy, if it gets set to Enum.RunContext.Client and is under StarterPlayerScripts it will run twice (once in StarterPlayerScripts and once in PlayerScripts). A subtle mistake that can easily cause some heartache if the dev is not aware of the issue at hand.

Additional context:
I use a plugin called ReClass that converts 1 instance to another 1 instance by copying all of the applicable properties over. One of the accidental hiccups that can occur is when converting a script to a localscript, the incorrect runcontext can be copied over without even realizing it, thus putting the script into an undesired state.

6 Likes

Please add this now roblox, we need it, I know I don’t use Reclass, but RunContext should be
changeable on normal scripts, ‘Legacy’ on LocalScript.

Also, setting the RunContext of a script to ‘Plugin’ would be gamebreaking, why can we do it throught Command Bar, and why is RunContext Server possible on LocalScripts?

1 Like

Just tested right now luckily it doesnt work phewww…

But the LocalScirpt.RunContext=Server actually does work (LOL)

here is a few screenshots as my evidence:
Zrzut ekranu 2024-02-23 205614

Zrzut ekranu 2024-02-23 205618

Zrzut ekranu 2024-02-23 205605

code that I used to generate this very confusing illegal “LocalScript” (WORKS ONLY IN COMMAND BAR)

local client=Instance.new("LocalScript") 
client.RunContext=Enum.RunContext.Server 
client.Parent=game.ServerScriptService
1 Like