How To OPEN SCRIPT WITH SCRIPT?

Hey, i try to find in all google how to open script with script and i dont find im want to use that for plugin to create script and then open it

local Script = Instance.new(Script, Sel:Get()[1])
Script.Name = “MyScript”

Script.Source = Message.Text

Script:OpenScript()

2 Likes

im using module script for the plugin

well i dont think opening scripts are possible

so how i see plugins that doing that like RoTasks

oh wait i think loadstring() would work
just do loadstring(code)

this is not open the script this is run the script

yeah its running the script from a string

but i want to open the script tab in roblox studio

why would you even wanna do that

What you are looking for is :OpenScript() which is a method of plugin.

image

Plugin | Roblox Creator Documentation

2 Likes

OpenScript is not a valid member of Script

Nooo not a method of script. I said a method of the plugin not the script?

Check the documentation I sent you.

1 Like

but im need to create script and then open the script tab not the plugin script tab

but that is so easy

local Script = Instance.new("Script", game:GetService("Selection"):Get()[1] or workspace)
Script.Name = "MyScript"
Script.Source = Message.Text

plugin:OpenScript(Script)
3 Likes

What? You said you want to open a script you create and open it in an editor? The method I sent you does that (“Used to open the given script instance in an editor window, in Roblox studio, at the given line. If no line is given as an argument it will default to 1”).

You would just create the script, store it as a variable or something then use this method passing in the script you just created.

I am confused on what you are confused about. It is as simple as just selecting the script you make and then opening it with the :OpenScript() method.

1 Like

but im use 2 script in 1 script i make the plugin toolbar and in the 2 script im create the script and more

i had a stroke reading that, im serious please say it more clearly

3 Likes

I don’t understand how this would affect anything at all? A plugin is a plugin, it will not change if you do code in diffrent scripts?

2 Likes

attempt to index nil with ‘OpenScript’

Show me the code you are trying.

1 Like