360系统下载 360系统重装 360重装大师 一键重装系统 360一键装机 360系统急救箱 360系统重装大师 360一键重装 360驱动大师 360网络急救箱 360软件管家官方 360系统急救箱 在线安装系统 重做系统 系统之家 win10系统 360安全卫士下载 360系统 360桌面管家 360手机卫士 360密盘 360系统盘 360系统恢复 360系统备份 360系统迁移 后台管理
📢 欢迎访问系统之家!所有资源均经过安全检测。

Instance

发布时间:2026-09-17 | 浏览:1
📥 下载地址(文章开头)
装机联盟专用系统,高速纯净快速
📥 下载地址(文章中间)
装机联盟专用系统,高速纯净快速
For Agents | This page is available as markdown: https://create.roblox.com/docs/en-us/reference/engine/classes/Instance.md | Documentation index: https://create.roblox.com/docs/llms.txt | Engine API index: https://create.roblox.com/docs/reference/engine/llms.txt Learn English Feedback Engine Class Instance Not Creatable Not Browsable Summary Properties Archivable : boolean archivable : boolean Deprecated Capabilities : SecurityCapabilities IsInSandbox : boolean Name : string Parent : Instance PredictionMode : Enum.PredictionMode RobloxLocked : boolean Deprecated Sandboxed : boolean UniqueId : UniqueId Methods AddTag ( tag : string ) : () children ( ) : Instances Deprecated ClearAllChildren ( ) : () Clone ( ) : Instance clone ( ) : Instance Deprecated Destroy ( ) : () destroy ( ) : () Deprecated FindFirstAncestor ( name : string ) : Instance ? FindFirstAncestorOfClass ( className : string ) : Instance ? FindFirstAncestorWhichIsA ( className : string ) : Instance ? FindFirstChild ( name : string , recursive : boolean ) : Instance ? findFirstChild ( name : string , recursive : boolean ) : Instance Deprecated FindFirstChildOfClass ( className : string ) : Instance ? FindFirstChildWhichIsA ( className : string , recursive : boolean ) : Instance ? FindFirstDescendant ( name : string ) : Instance ? GetActor ( ) : Actor ? GetAttribute ( attribute : string ) : Variant GetAttributeChangedSignal ( attribute : string ) : RBXScriptSignal GetAttributes ( ) : Dictionary GetChildren ( ) : Instances getChildren ( ) : Instances Deprecated GetDebugId ( scopeLength : number ) : string GetDescendants ( ) : Instances GetFullName ( ) : string GetStyled ( name : string , selector : string ? ) : Variant GetStyledPropertyChangedSignal ( property : string ) : RBXScriptSignal GetTags ( ) : {any} HasTag ( tag : string ) : boolean IsAncestorOf ( descendant : Instance ) : boolean IsDescendantOf ( ancestor : Instance ) : boolean isDescendantOf ( ancestor : Instance ) : boolean Deprecated IsPropertyModified ( property : string ) : boolean QueryDescendants ( selector : string ) : Instances Remove ( ) : () Deprecated remove ( ) : () Deprecated RemoveTag ( tag : string ) : () ResetPropertyToDefault ( property : string ) : () SetAttribute ( attribute : string , value : Variant ) : () WaitForChild ( childName : string , timeOut : number ) : Instance Events AncestryChanged ( child : Instance , parent : Instance ) : RBXScriptSignal AttributeChanged ( attribute : string ) : RBXScriptSignal ChildAdded ( child : Instance ) : RBXScriptSignal childAdded ( child : Instance ) : RBXScriptSignal Deprecated ChildRemoved ( child : Instance ) : RBXScriptSignal DescendantAdded ( descendant : Instance ) : RBXScriptSignal DescendantRemoving ( descendant : Instance ) : RBXScriptSignal Destroying ( ) : RBXScriptSignal StyledPropertiesChanged ( ) : RBXScriptSignal Inherited Members 6 inherited from Object Inherited by AccessoryDescription , Accoutrement , AdPortal , AdService , AdvancedDragger , Show more... API Reference Properties Archivable Read Parallel Instance.Archivable : boolean Code Samples Archivable local part = Instance.new( "Part" ) print (part:Clone()) --> Part part.Archivable = false print (part:Clone()) --> nil Provide feedback archivable Deprecated Show details Capabilities Read Parallel Capabilities: CapabilityControl Instance.Capabilities : SecurityCapabilities Provide feedback IsInSandbox Read Only Not Replicated Not Scriptable Read Parallel Instance.IsInSandbox : boolean Provide feedback Name Read Parallel Instance.Name : string Provide feedback Parent Not Replicated Read Parallel Instance.Parent : Instance Provide feedback PredictionMode Read Only Not Replicated Not Scriptable Read Parallel Instance.PredictionMode : Enum.PredictionMode Provide feedback RobloxLocked Deprecated Show details Sandboxed Not Replicated Read Parallel Capabilities: CapabilityControl Instance.Sandboxed : boolean Provide feedback UniqueId Not Replicated Roblox Script Security Roblox Security Read Parallel Instance.UniqueId : UniqueId Provide feedback Methods AddTag Instance:AddTag ( tag : string ) : () Parameters tag : string Returns () Provide feedback children Deprecated Show details ClearAllChildren Instance:ClearAllChildren ( ) : () Returns () Provide feedback Clone Capabilities: CreateInstances Simulation Access Instance:Clone ( ) : Instance Returns Instance Code Samples Cloning an Instance local Workspace = game :GetService( "Workspace" ) -- Get a reference to an existing object local model = script .Parent.Model -- Create a clone of the model local clone = model:Clone() -- Move the clone so it's not overlapping the original model clone:PivotTo(model.PrimaryPart.CFrame - (Vector3.xAxis * 10 )) -- Add the clone to the Workspace clone.Parent = Workspace Provide feedback clone Deprecated Show details Destroy Instance:Destroy ( ) : () Returns () Code Samples Instance:Destroy() local part = script .Parent.Part part:Destroy() Provide feedback destroy Deprecated Show details FindFirstAncestor Write Parallel Instance:FindFirstAncestor ( name : string ) : Instance ? Parameters name : string Returns Instance ? Provide feedback FindFirstAncestorOfClass Write Parallel Instance:FindFirstAncestorOfClass ( className : string ) : Instance ? Parameters className : string Returns Instance ? Provide feedback FindFirstAncestorWhichIsA Write Parallel Instance:FindFirstAncestorWhichIsA ( className : string ) : Instance ? Parameters className : string Returns Instance ? Provide feedback FindFirstChild Write Parallel Simulation Access Instance:FindFirstChild ( name : string , recursive : boolean ) : Instance ? Parameters name : string recursive : boolean Default Value: false Returns Instance ? Code Samples Instance:FindFirstChild local found = workspace :FindFirstChild( "Brick" ) if found then found.Name = "Foo" end Provide feedback findFirstChild Deprecated Show details FindFirstChildOfClass Write Parallel Instance:FindFirstChildOfClass ( className : string ) : Instance ? Parameters className : string Returns Instance ? Code Samples Instance:FindFirstChildOfClass local Players = game :GetService( "Players" ) local player = Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local humanoid while not humanoid do humanoid = character:FindFirstChildOfClass( "Humanoid" ) if not humanoid then character.ChildAdded:Wait() end end Provide feedback FindFirstChildWhichIsA Write Parallel Simulation Access Instance:FindFirstChildWhichIsA ( className : string , recursive : boolean ) : Instance ? Parameters className : string recursive : boolean Default Value: false Returns Instance ? Provide feedback FindFirstDescendant Write Parallel Instance:FindFirstDescendant ( name : string ) : Instance ? Parameters name : string Returns Instance ? Provide feedback GetActor Write Parallel Instance:GetActor ( ) : Actor ? Returns Actor ? Provide feedback GetAttribute Write Parallel Simulation Access Instance:GetAttribute ( attribute : string ) : Variant Parameters attribute : string Returns Variant Provide feedback GetAttributeChangedSignal Instance:GetAttributeChangedSignal ( attribute : string ) : RBXScriptSignal Parameters attribute : string Returns RBXScriptSignal Provide feedback GetAttributes Write Parallel Simulation Access Instance:GetAttributes ( ) : Dictionary Returns Dictionary Provide feedback GetChildren Write Parallel Simulation Access Instance:GetChildren ( ) : Instances Returns Instances Code Samples Instance:GetChildren local children = workspace :GetChildren() for i = 1 , #children do print (i, children[i].Name) end Provide feedback getChildren Deprecated Show details GetDebugId Not Browsable Plugin Security Instance:GetDebugId ( scopeLength : number ) : string Parameters scopeLength : number Default Value: 4 Returns string Code Samples Instance:GetDebugId print ( workspace :GetDebugId()) --> 39FA_12 print ( workspace :GetDebugId( 10 )) --> 39FA2FEF4D_12 print ( workspace :GetDebugId( math . huge )) --> 12 Provide feedback GetDescendants Write Parallel Simulation Access Instance:GetDescendants ( ) : Instances Returns Instances Code Samples Instance:GetDescendants local descendants = workspace :GetDescendants() -- Loop through all of the descendants of the Workspace. If a -- BasePart is found, the code changes that parts color to green for _, descendant in pairs (descendants) do if descendant:IsA( "BasePart" ) then descendant.BrickColor = BrickColor.Green() end end Provide feedback GetFullName Write Parallel Simulation Access Instance:GetFullName ( ) : string Returns string Code Samples Instance:GetFullName -- Create a simple hierarchy local model = Instance.new( "Model" ) local part = Instance.new( "Part" ) part.Parent = model local fire = Instance.new( "Fire" ) fire.Parent = part print (fire:GetFullName()) --> Model.Part.Fire model.Parent = workspace print (fire:GetFullName()) --> Workspace.Model.Part.Fire part.Name = "Hello, world" print (fire:GetFullName()) --> Workspace.Model.Hello, world.Fire Instance:GetFullName Lua Implementation local function getFullName (object) local result = object.Name object = object.Parent while object and object ~= game do -- Prepend parent name result = object.Name .. "." .. result -- Go up the hierarchy object = object.Parent end return result end print (getFullName( workspace .Camera)) --> Workspace.Camera Provide feedback GetStyled Instance:GetStyled ( name : string , selector : string ? ) : Variant Parameters name : string selector : string ? Returns Variant Code Samples Get Styled local Players = game :GetService( "Players" ) local ReplicatedStorage = game :GetService( "ReplicatedStorage" ) local player = Players.LocalPlayer local playerGui = player.PlayerGui local HUDContainer = playerGui:WaitForChild( "HUDContainer" ) local coreSheet = ReplicatedStorage:FindFirstChild( "CoreSheet" ) local rule = coreSheet:FindFirstChildWhichIsA( "StyleRule" ) rule.Selector = "TextButton" -- Reference to a button local button = HUDContainer:FindFirstChildWhichIsA( "TextButton" ) print (button:GetStyled( "Rotation" )) --> 0 (default value) print (button.Rotation) --> 0 (default value) -- Apply rotation through style rule property rule:SetProperty( "Rotation" , 30 ) print (button:GetStyled( "Rotation" )) --> 30 (styled value based on rule) print (button.Rotation) --> 0 (default value) -- Explicitly modify/override styled property button.Rotation = 45 print (button:GetStyled( "Rotation" )) --> 45 (modified value) print (button.Rotation) --> 45 (modified value) Provide feedback GetStyledPropertyChangedSignal Instance:GetStyledPropertyChangedSignal ( property : string ) : RBXScriptSignal Parameters property : string Returns RBXScriptSignal Code Samples Get Styled Property Changed Signal local Players = game :GetService( "Players" ) local player = Players.LocalPlayer local playerGui = player.PlayerGui local HUDContainer = playerGui:WaitForChild( "HUDContainer" ) local meterBar = HUDContainer.MeterBar local function stylePropertyChanged () print ( "Style property changed!" ) end meterBar:GetStyledPropertyChangedSignal( "AnchorPoint" ):Connect(stylePropertyChanged) Provide feedback GetTags Write Parallel Simulation Access Instance:GetTags ( ) : {any} Returns {any} Provide feedback HasTag Write Parallel Simulation Access Instance:HasTag ( tag : string ) : boolean Parameters tag : string Returns boolean Provide feedback IsAncestorOf Write Parallel Simulation Access Instance:IsAncestorOf ( descendant : Instance ) : boolean Parameters descendant : Instance Returns boolean Code Samples Instance:IsAncestorOf() local Workspace = game :GetService( "Workspace" ) local spawnLocation = Workspace.SpawnLocation local decal = spawnLocation.Decal -- These statements are true print (Workspace:IsAncestorOf(spawnLocation)) print (Workspace:IsAncestorOf(decal)) print (spawnLocation:IsAncestorOf(decal)) -- These statements are false print (spawnLocation:IsAncestorOf(Workspace)) print (decal:IsAncestorOf(Workspace)) print (decal:IsAncestorOf(spawnLocation)) Provide feedback IsDescendantOf Write Parallel Simulation Access Instance:IsDescendantOf ( ancestor : Instance ) : boolean Parameters ancestor : Instance Returns boolean Code Samples Instance:IsDescendantOf local part = Instance.new( "Part" ) print (part:IsDescendantOf( game )) --> false part.Parent = workspace print (part:IsDescendantOf( game )) --> true part.Parent = game print (part:IsDescendantOf( game )) --> true Provide feedback isDescendantOf Deprecated Show details IsPropertyModified Simulation Access Instance:IsPropertyModified ( property : string ) : boolean Parameters property : string Returns boolean Provide feedback QueryDescendants Simulation Access Instance:QueryDescendants ( selector : string ) : Instances Parameters selector : string Returns Instances Provide feedback Remove Deprecated Show details remove Deprecated Show details RemoveTag Instance:RemoveTag ( tag : string ) : () Parameters tag : string Returns () Provide feedback ResetPropertyToDefault Instance:ResetPropertyToDefault ( property : string ) : () Parameters property : string Returns () Provide feedback SetAttribute Simulation Access Instance:SetAttribute ( attribute : string , value : Variant ) : () Parameters attribute : string value : Variant Returns () Provide feedback WaitForChild Can Yield Instance:WaitForChild ( childName : string , timeOut : number ) : Instance Parameters childName : string timeOut : number Returns Instance Code Samples Instance:WaitForChild local part = workspace :WaitForChild( "Part" ) print (part.Name .. " has been added to the Workspace" ) Provide feedback Events AncestryChanged Instance.AncestryChanged ( child : Instance , parent : Instance ) : RBXScriptSignal Parameters child : Instance parent : Instance Code Samples Instance.AncestryChanged local Workspace = game :GetService( "Workspace" ) local redPart = script .Parent.RedPart local bluePart = script .Parent.BluePart local changingPart = script .Parent.ChangingPart -- Change the color of changingPart based on it's Parent local function onAncestryChanged (part: Part, parent: Instance) if parent == redPart then changingPart.Color = Color3.new( 1 , 0 , 0 ) elseif parent == bluePart then changingPart.Color = Color3.new( 0 , 0 , 1 ) else changingPart.Color = Color3.new( 1 , 1 , 1 ) end print ( ` {part.Name} is now parented to {parent.Name} ` ) end changingPart.AncestryChanged:Connect(onAncestryChanged) -- Set changingPart's Parent property to different instances over time while true do task . wait ( 2 ) changingPart.Parent = redPart task . wait ( 2 ) changingPart.Parent = bluePart task . wait ( 2 ) changingPart.Parent = Workspace end Provide feedback AttributeChanged Instance.AttributeChanged ( attribute : string ) : RBXScriptSignal Parameters attribute : string Provide feedback ChildAdded Instance.ChildAdded ( child : Instance ) : RBXScriptSignal Parameters child : Instance Code Samples Instance.ChildAdded local function onChildAdded (instance) print (instance.Name .. " added to the workspace" ) end workspace .ChildAdded:Connect(onChildAdded) local part = Instance.new( "Part" ) part.Parent = workspace --> Part added to the Workspace Provide feedback childAdded Deprecated Show details ChildRemoved Instance.ChildRemoved ( child : Instance ) : RBXScriptSignal Parameters child : Instance Code Samples Instance.ChildRemoved local function onChildRemoved (instance) print (instance.Name .. " removed from the workspace" ) end workspace .ChildRemoved:Connect(onChildRemoved) local part = Instance.new( "Part" ) part.Parent = workspace task . wait ( 2 ) part:Destroy() Provide feedback DescendantAdded Instance.DescendantAdded ( descendant : Instance ) : RBXScriptSignal Parameters descendant : Instance Code Samples Instance.DescendantAdded local function onDescendantAdded (descendant) print (descendant) end workspace .DescendantAdded:Connect(onDescendantAdded) local part = Instance.new( "Part" ) part.Parent = workspace Provide feedback DescendantRemoving Instance.DescendantRemoving ( descendant : Instance ) : RBXScriptSignal Parameters descendant : Instance Code Samples Instance.DescendantRemoving workspace .DescendantRemoving:Connect( function (descendant) print (descendant.Name .. " is currently parented to " .. tostring (descendant.Parent)) end ) local part = Instance.new( "Part" ) part.Parent = workspace part.Parent = nil --> Part is currently parented to Workspace print (part.Parent) --> nil Provide feedback Destroying Instance.Destroying ( ) : RBXScriptSignal Code Samples Using the Destroying Event (Immediate signals) local part = Instance.new( "Part" , workspace ) local function onPartDestroying () print ( "Before yielding:" , part:GetFullName(), #part:GetChildren()) task . wait () print ( "After yielding:" , part:GetFullName(), #part:GetChildren()) end part.Destroying:Connect(onPartDestroying) part:Destroy() Using the Destroying Event (Deferred signals) local part = Instance.new( "Part" , workspace ) local function onPartDestroying () print ( "In signal:" , part:GetFullName(), #part:GetChildren()) end part.Destroying:Connect(onPartDestroying) print ( "Before destroying:" , part:GetFullName(), #part:GetChildren()) part:Destroy() print ( "After destroying:" , part:GetFullName(), #part:GetChildren()) Provide feedback StyledPropertiesChanged Instance.StyledPropertiesChanged ( ) : RBXScriptSignal Code Samples Styled Properties Changed local Players = game :GetService( "Players" ) local player = Players.LocalPlayer local playerGui = player.PlayerGui local HUDContainer = playerGui:WaitForChild( "HUDContainer" ) local meterBar = HUDContainer.MeterBar local function stylePropertyChanged () print ( "Styled properties changed" ) end meterBar:StyledPropertiesChanged():Connect(stylePropertyChanged) Provide feedback Jump to ▼ Instance Summary Properties Methods Events Properties Archivable archivable Capabilities IsInSandbox Name Parent PredictionMode RobloxLocked Sandboxed UniqueId Methods 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() Events AncestryChanged AttributeChanged ChildAdded childAdded ChildRemoved DescendantAdded DescendantRemoving Destroying StyledPropertiesChanged English Feedback ©2026 Roblox Corporation. Roblox, the Roblox logo and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries. Terms · Privacy · Accessibility · Support English
📥 下载地址(文章结尾)
装机联盟专用系统,高速纯净快速