Class
InstanceFileSyncService
NotCreatableServiceNotReplicated
A service for interacting with file sync from a plugin.
The InstanceFileSyncService service provides an interface for plugins to
interact with the file sync system (currently known as Script Sync). It
allows querying the sync status of instances and retrieving instances based on
file paths.
Methods 3#
| GetAllInstances | Returns an array of all instances currently involved in file synchronization.PluginSecurity security |
| GetStatus | Returns the synchronization status of a specific instance.PluginSecurity security |
| GetSyncedInstance | Returns the instance corresponding to a given file path.PluginSecurity security |
GetAllInstances(): Instances#
PluginSecurity security
Returns an array containing every Instance that is currently being
tracked or synchronized by file sync.
Returns
Instances— Returns an array ofInstances.
GetStatus(instance: Instance): InstanceFileSyncStatus#
PluginSecurity security
Returns the current InstanceFileSyncStatus of the provided
Instance. This indicates whether the instance is synced as a root,
as a descendant, or if it is in an error state.
| Name | Type | Default | Description |
|---|---|---|---|
instance | Instance | The instance to check. |
Returns
InstanceFileSyncStatus— Returns theInstanceFileSyncStatusfor the instance.
GetSyncedInstance(filePath: string): Instance?#
PluginSecurity security
Returns the Instance associated with the specified absolute file
path. Returns nil if the path is not mapped to any instance.
| Name | Type | Default | Description |
|---|---|---|---|
filePath | string | The absolute path to the file. |
Returns
Instance?— Returns the Instance being synced to the file path, if one exists. Otherwise, returns nil.
Events 1#
| StatusChanged | Fires when the synchronization status of an instance changes.PluginSecurity security |
StatusChanged(instance: Instance, status: InstanceFileSyncStatus)#
PluginSecurity security
This event fires when the InstanceFileSyncStatus of an
Instance changes. It passes the affected instance and the new file
sync status enum value.
| Name | Type | Default | Description |
|---|---|---|---|
instance | Instance | The instance whose status changed. | |
status | InstanceFileSyncStatus | The new synchronization status. |
Inherited members#
Inherited from Instance 58
Properties (10)
Archivable, archivable, Capabilities, IsInSandbox, Name, Parent, PredictionMode, RobloxLocked, Sandboxed, UniqueId
Methods (39)
AddTag, children, ClearAllChildren, Clone, clone, Destroy, destroy, FindFirstAncestor, FindFirstAncestorOfClass, FindFirstAncestorWhichIsA, FindFirstChild, findFirstChild, FindFirstChildOfClass, FindFirstChildWhichIsA, FindFirstDescendant, GetActor, GetAttribute, GetAttributeChangedSignal, GetAttributes, GetChildren, getChildren, GetDebugId, GetDescendants, GetFullName, GetStyled, GetStyledPropertyChangedSignal, GetTags, HasTag, IsAncestorOf, IsDescendantOf, isDescendantOf, IsPropertyModified, QueryDescendants, Remove, remove, RemoveTag, ResetPropertyToDefault, SetAttribute, WaitForChild