RunLSC - Run script(s) by selecting them and clicking a button

Some of you may have noticed this was reposted, I unfortunately lost my old account that posted the original post which is why I reposted it under this account

There doesn’t seem to be a feature where you can directly run scripts by simply selecting a single or multiple scripts and clicking a button to automatically run them, so I decided to write a simple plugin for doing exactly that

Limitations
  • If loadstring is not available, then it will fall back to using Yueliang + FiOne for code execution, otherwise it will use Roblox’s provided loadstring (this is usually on the client, however I plan to fix this with a alternative eventually)

Suggestions and pull requests are welcome if you would like to contribute.

10 Likes

I kinda want to expand the functionality of this plugin,

Should I add a built-in script editor for executing scripts from a gui as an alternative from the command bar/selecting scripts?
  • Yes
  • No

0 voters

Unfortunately there is a “run script” button in the models tab if i remember correctly.

Pretty sure it only works with external .lua files, not scripts that you have in studio

2 Likes

I’ve found an alternative way of running code on the client without the usage of a Luau-based loadstring, so I might be able to implement it this week, however one caveat is that when you play test it will have to create a internal folder on ReplicatedStorage or anywhere replicated from server to client to store a remote and a cache system. The good thing about this is, you use the native interpreter instead.

When I do implement it, I’ll most likely keep the FiOne + Yueliang loadstring as a alternative client code execution method incase something breaks this, particularly hacky way.

Are you comfortable with sharing this method?

I’ll write it here with more detail tommorow maybe or when I actually do implement it, but it’s pretty simple actually

Great stuff, you should add a keybind so it’s just simply easier for future use. Nevermind, Roblox being Roblox never add this feature yet even though it’s been requested.

I wonder what is this for then:
https://create.roblox.com/docs/reference/engine/classes/Plugin#CreatePluginAction

1 Like

Progress on the natively compiling and running on the client:
image

This involved a full rewrite aswell

@commitblue Regarding sharing the method, see the following commit:

1 Like

Genius. I knew getfenv, _G all together had global functions before but genius.

Executor UI preview:

I’ll also provide a option to use the native script editor aswell (requires the new script document api) (similar to how BytExecutor uses the native script editor instead)

Hi, i have 3 questions:

  1. Is it functional yet?
  2. Does it include Syntax Highlighting?
  3. Can it autocomplete?
  1. Minimally functional at this time of development (can run code and syntax highlighting)
  2. Yes, syntax highlighting using boatbomber’s Highlighter module
  3. No, I do not know how to make autocomplete for this unfortunately (would be nice if someone could tell me)

And as for using the native Studio script editor, yes it is planned, just needs some more work to handle.

1 Like

Integrating Studio’s script editor as the alternative editor: (still wip)
image

Settings ui: (very wip atm)
image
Yes, I’ve intentionally made it similar to the properties widget

As for the native script editor implementation, I’ve decided to seperate the executor widget into 2 different widgets, the Lua-based editor widget and a actions widget:
image

1.3 is now out:

Details (copied from the release at GitHub)

Full Changelog: 1.2...1.3
Changes:

  • Complete plugin rewrite
  • All (edit, server, client) contexts support running source natively (aka using Studio’s native Luau compiler and interpreter) (there is still a option in settings to still only use Yueliang and FiOne, keep in mind nearly no support will be provided for this and client still uses native compiler and interpreter at the moment regardless of that setting)
  • A settings ui for managing various settings
  • An executor UI, you can use either the native script editor (default) or the Luau-based editor, editor method is changeable via settings. Also supports running in edit, server, and client contexts
    image

Known bugs:

  • Line marking on the executor’s Luau-based editor is broken
  • Client context does not support running source via FiOne and Yueliang (native only)
  • The settings ui setting field name can overlap, workaround is to widen the window to see the whole text at the moment (still looking for solutions for this issue)
  • Missing unlock settings lock button

Hi! I am once again asking if it includes autocomplete?

If it doesn’t. You can use your Syntax Highlighter (which is made by boatbomber) find the line where the cursor is at (by tweaking the module) get the text bounds of the current line and add frame with prompts.