Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can I edit the content of a script with another script?

I'm working on a plugin in ROBLOX Studio and would like to make a script and edit it with the plugin script, How can I make this?

Also please explain everything clear, thanks! :)

2 comments

0

plugin:OpenScript

0

Ok thanks! I think this will probably help :)

1 answer

✓ Accepted answer

Hi!

You can edit scripts by directly changing the .Source property of the specified script. Keep in mind that .Source is PluginSecurity and can only be changed by Plugins, the command bar, and CoreScripts. Like incapaz said, after editing, calling plugin:OpenScript will open up the script.

local s = someScriptPath
s.Source = "--[[line1\nline2\nline3\n\nline5]]" -- Sets the script source.
plugin:OpenScript(s) -- Opens the script.

2 comments

0

I'm just not sure about that --[[line1\nline2\nline3\n\nline5]]

0

Its fine. \n breaks a new line.

This discussion is preserved as it was. New answers, comments, and votes are closed.