Reading scripts with plugins?

Is it possible for a plugin to read scripts in studio? I could use any help avaible

4 Likes

Do you mean how to check the source code of a plug-in? Or how to let a plug-in read a scripts source code?

Not from what I know currently. There are no such plugin that is able to read scripts. What is the purpose of a plugin that is able to read a script?

Plugins have a special level of “security” known as PluginSecurity, with this you can read, and modify scripts. You can also create your own scripts using plugins.

So to answer your question directly, yes! be careful with the plugins you install.

11 Likes

Yes. See this for more info: Script | Documentation - Roblox Creator Hub

4 Likes

Is there a way for a plugin to get the context of a script and to edit the context? And by edit I mean like modify a certain part of the script.

No, plugins don’t have the security to do that. They can only read/write a script’s source

They can only read/write a script’s source

That’s the same thing as context… Is there a way for plugins to get the source code and edit parts of it…

Context in terms of Roblox is Server or Client

Yes, you can write the source.

-- plugin-script

local targetScript = workspace.Script

targetScript.Source = "print(\"script source changed\")"

To get certain parts, you would need to use the string and table libraries because the script’s source only returns a long string

This may be a stupid question, but is there a good reason why the source returns a string instead of like actually accessing the script?

I’m not actually sure, I think it’s because the script’s source is compiled as a string I think

What do you mean by “actually accessing the script”?

What do you mean by “actually accessing the script”?

Like referencing the script but actually saving the changes to the source.

To get certain parts, you would need to use the string and table libraries because the script’s source only returns a long string

Actually, I think I could just encode and decode the module, edit the decoded module then turn it back to a string and put that as its source code. And yes somewhere in code I would need to insert “local module = {}” and “return module” into the string, but it could work.

1 Like