Any way to shorten plugin scripts?

Right now, my plugin script is nearly 6,000 lines and I’m only about 1/10 done - about 5,975 of those lines are from my GUI to LUA Converter. It’s getting pretty annoying have to scroll through all this code every time I want to push an update. Any help appreciated!

1 Like

You could use module scripts and perhaps remove spaces and possible repeated functions?


I wish I could remove repeated functions… however every script has like 3-4 values changed and it gets annoying lol. I might though ya

1 Like

Could you show the tree and a little bit of how the code looks?

Here is a good plugin i use to make it neater and remove extra spaces

Found a cool plugin called Minifyer that makes scripts 1 line, Thanks!

1 Like

How would you edit that :thinking:

1 Like

Yeah, I don’t recommend Minifying. If you need to make an update, it’s going to be a real pain to find what you need to update. Plus, this “1 line” is LOOOOOOONG, assuming your script has 6k lines.

As @Suuzv said, I highly recommend you use ModuleScripts.

Instead of using a GUI to Lua converter, you could also keep the UI assets and just clone and modify them when needed.

Moreover, having a long script doesn’t really matter to be honest. If you really need to find something important, just organize your script with comments. Like -- Begining of bla bla -- End of bla bla. If you also know your script well (since you made it), you should be able to find what you need in it. It might be a problem if the script editor becomes laggy, but there are solutions to that.

1 Like

Just edit the actual script, then use the GUI to Lua again, then minify it again.

Actually, can you clone UI elements for a plugin widget??

Oh, I wasn’t aware that you were using GUI to Lua for the plugin’s widget. To be honest, I’m not 100% sure as I don’t have experience in making plugins.

Though, I’m confused:

You said you’re looking for a solution about having a really long script. But what’s the point of minifying your script if you’re actually looking back at the actual script? You would still need to scroll through all of the lines, which is why I’m confused. It’s also pointless if you really have to look back at the actual script and minify it just to make an update. Why not just use the actual script as the plugin’s script? Wouldn’t that be easier? You would save like 10 seconds. It’s not a lot but you get it.

Mhm. I’m just going to try to clone the UI into the widget somehow.