Skip to content
Roblox API Reference

ScriptEditorService

This service is used for interacting with ScriptDocument instances.
  • Not creatable
  • Not replicated
  • Service
Memory category
Instances
Own members
21
Inherited members
75
Subclasses
0
Siblings
608

Properties23

Inherited fromObject2

Property categoryData

Inherited fromInstance21

Property categoryBehavior

Property categoryData

Property categoryPermissions

Methods60

Inherited fromObject3
  • Get an event that fires when a given property of the object changes.
    Parameters
    ParameterDescription
    property: string
    The property to connect to.
    Returns
    TypeDescription
    RBXScriptSignal
    A signal that fires whenever the property changes.
  • Object:IsA(className: string): boolean
    Returns true if an object's class matches or inherits from a given class.
    • Custom Lua state
    • Thread safe
    Parameters
    ParameterDescription
    className: string
    The class against which the Object's class will be checked. Case-sensitive.
    Returns
    TypeDescription
    boolean
    Describes whether the Object's class matched or is a subclass of the given class.
  • Object:isA(className: string): boolean
    Deprecated: This deprecated function is a variant of Object:IsA() which should be used instead.
    • Deprecated
    • Custom Lua state
    Parameters
    Parameter
    className: string
    Returns
    Type
    boolean

    Use IsA instead.

Inherited fromInstance39
Defined byScriptEditorService18
  • ScriptEditorService:ClearUriScript(uri: string)
    • Roblox script security
    Parameters
    Parameter
    uri: string
  • ScriptEditorService:DeregisterAutocompleteCallback(name: string)
    Removes a previously registered callback with the name name.
    • Plugin security
    Parameters
    ParameterDescription
    name: string
    The identifier that was used when registering the callback with ScriptEditorService:RegisterAutocompleteCallback().
  • ScriptEditorService:DeregisterScriptAnalysisCallback(name: string)
    Removes a previously registered callback with the name name.
    • Plugin security
    Parameters
    ParameterDescription
    name: string
    The identifier that was used when registering the callback with ScriptEditorService:RegisterScriptAnalysisCallback().
  • ScriptEditorService:EditSourceAsyncWithRanges(script: LuaSourceContainer,newText: string,startLine: number,startCharacter: number,endLine: number,endCharacter: number,): ...any
    • Yields
    • Roblox script security
    Parameters
    Parameter
    script: LuaSourceContainer
    newText: string
    startLine: number
    startCharacter: number
    endLine: number
    endCharacter: number
    Returns
    Type
    ...any
  • ScriptEditorService:FindScriptDocument(script: LuaSourceContainer): ScriptDocument
    Returns the open ScriptDocument corresponding to the given LuaSourceContainer, or nil if the given script is not open.
    • Plugin security
    Parameters
    ParameterDescription
    script: LuaSourceContainer
    The LuaSourceContainer (such as a Script, LocalScript, or ModuleScript) to find the open document for.
    Returns
    TypeDescription
    ScriptDocument
    The open ScriptDocument corresponding to the given script, or nil if the script is not currently open in the Script Editor.
  • ScriptEditorService:ForceReloadSource(uri: string, newsrc: string)
    • Roblox script security
    Parameters
    Parameter
    uri: string
    newsrc: string
  • ScriptEditorService:GetEditorSource(script: LuaSourceContainer): string
    Returns the edit-time source for the given script.
    • Plugin security
    Parameters
    ParameterDescription
    script: LuaSourceContainer
    The LuaSourceContainer to retrieve the edit-time source text for.
    Returns
    TypeDescription
    string
    The edit-time source text of the script as a string.
  • ScriptEditorService:GetScriptDocuments(): { Instance }
    Returns an array of the currently open script documents, including the command bar.
    • Plugin security
    Returns
    TypeDescription
    { Instance }
    An array of ScriptDocument objects representing all currently open editor tabs, including the command bar.
  • ScriptEditorService:IsAutocompleteCallbackRegistered(name: string): boolean
    • Roblox script security
    Parameters
    Parameter
    name: string
    Returns
    Type
    boolean
  • ScriptEditorService:IsScriptAnalysisCallbackRegistered(name: string): boolean
    • Roblox script security
    Parameters
    Parameter
    name: string
    Returns
    Type
    boolean
  • ScriptEditorService:OpenScriptDocumentAsync(script: LuaSourceContainer,options: { [string]: any }? = nil,): ...any
    Requests that a Script Editor open the specified script. Returns (true, nil) if the request succeeds. Returns (false, string) if the request fails, with a string that describes the problem.
    • Yields
    • Plugin security
    Parameters
    ParameterDescription
    script: LuaSourceContainer
    The LuaSourceContainer to open in the Script Editor.
    options: { [string]: any }? = nil
    A dictionary that supports the following options:
    • Temporary — Boolean. Whether to open the script in a preview tab. Default is false.
    • HighlightRange — A nested dictionary containing a line and character range to highlight in the editor. Example: HighlightRange = { Start = { Line = 10, Character = 1 }, End = { Line = 15, Character = 20 }}.
    Returns
    TypeDescription
    ...any
    A tuple where the first value is a boolean indicating success and the second is nil on success or a string describing the problem on failure.
  • ScriptEditorService:OpenStringValueDocumentAsync(stringValue: StringValue,options: { [string]: any }? = nil,): ...any
    • Yields
    • Roblox script security
    Parameters
    Parameter
    stringValue: StringValue
    options: { [string]: any }? = nil
    Returns
    Type
    ...any
  • ScriptEditorService:OpenTemporaryDocumentAsync(scriptId: string,initialContent: string,): ...any
    • Yields
    • Roblox script security
    Parameters
    Parameter
    scriptId: string
    initialContent: string
    Returns
    Type
    ...any
  • ScriptEditorService:RegisterAutocompleteCallback(name: string,priority: number,callbackFunction: (...any) -> ...any,)
    Registers an autocomplete callback callbackFunction named name with priority priority.
    • Plugin security
    Parameters
    ParameterDescription
    name: string
    A unique identifier for this callback, used to deregister it later with ScriptEditorService:DeregisterAutocompleteCallback().
    priority: number
    The invocation order among registered callbacks; lower values run first.
    callbackFunction: (...any) -> ...any
    The function invoked during autocomplete with the signature (Request: table, Response: table) -> table.
  • ScriptEditorService:RegisterScriptAnalysisCallback(name: string,priority: number,callbackFunction: (...any) -> ...any,)
    Registers a Script Analysis callback callbackFunction named name with priority.
    • Plugin security
    Parameters
    ParameterDescription
    name: string
    A unique identifier for this callback, used to deregister it later with ScriptEditorService:DeregisterScriptAnalysisCallback().
    priority: number
    The invocation order among registered callbacks; lower values run first.
    callbackFunction: (...any) -> ...any
    The function invoked during Script Analysis with the signature (Request: table) -> table, returning a response containing diagnostics.
  • ScriptEditorService:SetUriScript(uri: string, source: string)
    • Roblox script security
    Parameters
    Parameter
    uri: string
    source: string
  • ScriptEditorService:StripComments(code: string): string
    • Roblox script security
    Parameters
    Parameter
    code: string
    Returns
    Type
    string
  • ScriptEditorService:UpdateSourceAsync(script: LuaSourceContainer,callback: (...any) -> ...any,)
    Generates new content from the old script and updates the script editor if it's open, or the Script instance if the script editor is closed.
    • Yields
    • Plugin security
    Parameters
    ParameterDescription
    script: LuaSourceContainer
    Script instance to be updated.
    callback: (...any) -> ...any
    The function to return new script content.

Events13

Inherited fromObject1
Inherited fromInstance9
Defined byScriptEditorService3