Skip to content

Service · inherits Instance

PluginConnectionService

Official docs ↗

This service is used by plugins to communicate with other instances of themselves running in other data models.

About PluginConnectionService

This service is used by plugins to communicate with other instances of themselves running in other data models (e.g. a plugin in the Studio edit data model can communicate with the instance of that same plugin in the Studio playtest Server data model). Plugins can retrieve PluginConnection objects from this service, which provide an API for sending messages across the data model boundary. All access to this class is restricted to Plugin security. The command bar is not currently supported.

Methods 2

  • CanHaveConnectionType(type: PluginConnectionTargetType) → booleanPluginChecks if the current data model context can ever have connections of a given type.

    Checks if the current data model can potentially have connections of a given PluginConnectionTargetType. Note that it is possible for this function to return true even if no such connections currently exist.

  • GetPluginConnectionsOfType(type: PluginConnectionTargetType) → List<PluginConnection>PluginReturns a list of currently connected PluginConnection objects with the given connection type.

    Returns a list of currently connected PluginConnection objects with the given connection type. Each PluginConnection from this list will initially have their Connected property set to true and correspond to a connected data model related to the current data model according to their PluginConnectionTargetType. For example, an edit data model may have PluginConnectionTargetType.Test connections to communicate with its ongoing playtest data models, and each test data model will have an PluginConnectionTargetType.Edit connection back to its edit data model.

Events 1

  • ConnectedPluginConnectionService.Connected:Connect(function(conn))PluginFires just after a new PluginConnection successfully connects.

    Fires just after a new PluginConnection successfully connects. Plugins may listen for this signal to learn when a new data model that they can communicate with becomes available.

    Note: On startup, it is possible some PluginConnections already exist. Plugins should query PluginConnectionService.GetPluginConnectionsOfType for each type they are interested in after connecting to this function.

PluginConnectionService also has every member of Instance. Deprecated and Roblox-only members are hidden.

Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.