Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 5 years ago

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! :)

0
plugin:OpenScript User#19524 175 — 5y
0
Ok thanks! I think this will probably help :) BabyDevil285 9 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago
Edited 5 years ago

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.
0
I'm just not sure about that --[[line1\nline2\nline3\n\nline5]] BabyDevil285 9 — 5y
0
Its fine. \n breaks a new line. Thundermaker300 554 — 5y
Ad

Answer this question