export type InstancePropertiesList = Partial>; export declare namespace InstanceTools { /** * creates instance * @param class_name * @param properties partial properties * @returns created instancce */ function Create(class_name: T, properties: InstancePropertiesList, callback?: (intance: CreatableInstances[T]) => void): CreatableInstances[T]; /** * destroys all children of instance * @param instance * @returns */ function ClearChildren(instance: T): T; /** * @param instance * @param properties partial properties * @returns */ function AsignProperties(instance: T, properties: InstancePropertiesList): T; /** * checks if the descendant of some of the instances * @param instance * @param possible_ancestor_list possible ancestors * @returns */ function IsDescendantOf(instance: Instance, possible_ancestor_list: Instance[]): boolean; /** * loads a copy of settings from module script as an interface, and takes missing values from default settings * @param module_script module script where are the settings * @param default_settings default settings * @returns copy of settings loaded from module script */ function LoadSettingsFromModuleScript(module_script: ModuleScript, default_settings: T): T; /**finds the ancestor that meets the criteria of the check function */ function FindAncestor(instance: Instance, check_function: (instance: Instance) => boolean): Instance | undefined; /**looks for the child where check_function return true */ function FindChild(instance: Instance, check_function: (instance: Instance) => boolean, recursive?: boolean): Instance | undefined; /**looks for the ancestor which is a character that belongs to a player * @param check_full_ancestry if the part is deep in the character e.g Head.OtherPart.ThisPart, can be used to detect the character */ function GetPlayerCharacterFromInstace(part: Instance, check_full_ancestry?: boolean): Model | undefined; /**looks for the ancestor which is a character and returns a player associated with it */ function GetPlayerFromInstance(part: Instance, check_full_ancestry?: boolean): Player | undefined; /**checks the backpack and the character */ function SearchToolInPlayer(player: Player, tool_name: string): Instance | undefined; /**clears all the tags from the instance */ function RemoveTags(instance: Instance): void; /**cleans all the the tags from the instance and it's descendants */ function DeepRemoveTags(instance: Instance): void; function WaitForPath(instance: Instance, path: string[]): T; function FindFirstOnPath(instance: Instance, path: string[]): T | undefined; /**returns random position in part */ function GetRandomPositionInPart(part: BasePart): Vector3; /** * creates the item for the server and client, has to be called from the both sides * @param name * @param parent * @param class_name * @param properties * @returns */ function DefineItem(name: string, parent: Instance, class_name: T, properties: InstancePropertiesList): CreatableInstances[T]; /** * gets or creates the instance of type * @param name * @param parent * @param class_name * @param properties * @returns */ function GetOrCreate(name: string, parent: Instance, class_name: T, properties: InstancePropertiesList): CreatableInstances[T]; }