[Live] Script RunContext

This subtle change has so many amazing implications, awesome job!

Two things that I’d like to see still that would make life much easier:

  • Allow clicking on output in the studio to link you back to the source of the original script, even for copies of a script. This subtle fix would help reduce the pain of debugging cloned scripts that makes it so hard to write code in that style and usually makes me opt for modules instead (modules are less of an option now due to them not caching in parallel scripts :pensive:)

  • Allow modules to have an option to hide their source on the client / emit an error if you require them on the client. This would improve code organization possibilities significantly, as there would no longer be a need to always stash protected server modules in ServerStorage/ServerScriptService

5 Likes

Made up this neat cross-place game framework example using this new feature. Any opinions on it or ideas to make it better?
Packagelinks are assets synced across places.

4 Likes

Really awesome update, looking forward to creating new organization patterns with my code.

1 Like

This doesn’t show anything? Show the code for better example as this doesn’t give any insight.

Does this update mean exploiters won’t be able to view client code and download it?

Okay, this is definitely the best update in 2022. I’ve been waiting this for years and it’s finally here. Thank you so much for adding this feature into roblox.

Well, no, because exploiters can see every scripts that are executed from the client.

1 Like

Is it writeable in runtime? just asking

either way thank you

If thats what you mean. You can change it in studio while playing as well

Sounds like a big change that would take some time to get used to. Everything is just confusing to me right now. But I’m sure there would be some benefit to this new change, so when I get some free time… I will check it out. Peace.

This very urgently needs to be addressed:
I am also experiencing this issue. When I go through my script previous versions, this is what is shown.


I can compare the previous versions, but attempting to click “Open Script” on the past version causes studio to entirely crash.
I am literally stuck: I can’t copy and paste a previous version and my scripts are literally empty. I don’t know what caused this, and I don’t know how to fix it. Comparing with previous versions seems to work, but I can’t copy and paste from this menu. I have to manually re-type the code again.
I am running studio Version 0.541.205.5410428 (64bit)

1 Like

So if we change the script context in the studio, will it also work in-game? Or it’s not published on live servers yet?

usually to make stuff like client side effects you’d have to put a local script in a place like Replicated First or Starter Player Scripts (because local scripts wouldn’t work when their in workspace or someone else’s character) and the same goes for remote events

image

but with this update you can put everything under one object which makes them easier to find and edit

image

This is absolutely amazing!
Now I can finally put client scripts in Workspace and other locations where normally server scripts would only run.

This is going to make it much easier to make a singleplayer-oriented game where I just want most logic to run on the client and not change the locations of the scripts.

1 Like

Restricting where scripts can execute as a place-wide setting might be a good deterrent for “virus” free models. A lot of malicious scripts parent themselves to hidden services, making them harder to detect.

I’m sorry, but I don’t feel like there is much of a use case to this. Because of the fact that plugins can change a server script to a local script in ONE click.

We also can’t change the scripts run context from other scripts. Making this just like having a local script in a script. When we could just change it in an instant instead.

Please explain, how this is useful? Have I misunderstood something? Or is this feature just something Roblox decided to spend time on for no reason?

I am having a similar issue when I open up older versions of scripts it just flat out crashes my studio and its done it ever since this update

This needs to be fixed

I am using version: 0.541.0.5410422 (64bit)

3 Likes

Really don’t understand why this was needed. Seems like a waste of time for the engineers. I think the current system was fine.

@ColRealPro @koob85

We tracked down the script version history issue. Reverting to previous versions should work again now after a Studio restart, sorry for the trouble.

FYI: We had to disable the code that changes the script icons depending on the RunContext to fix it. RunContext will still behave they way it should but the icons won’t switch depending on RunContext for the time being.

4 Likes

No, in a server-side context, reading Players.LocalPlayer will always return nil. The server is a manager of all players, not just one. Only a LocalScript, ModuleScript required by a LocalScript, or a Script with its RunContext set to Client can successfully get a value out of it.