Instance
Instance : InstanceBase
Overview
Instance๋ Workspace, ReplicatedStorage, ServerStorage ๋ฑ DataModel ํธ๋ฆฌ์ ์ํ ์ ์๋ ๋ชจ๋ ๊ฐ์ฒด์ ์ต์์ ๊ธฐ๋ณธ ํด๋์ค์ ๋๋ค.
Instance.new() ์์ฑ์๋ฅผ ์ฌ์ฉํ๋ฉด Part, ParticleEmitter ๋ฑ ์ง์ ํ ๊ฐ์ฒด๋ฅผ ๋ฐํ์์์ ๋์ ์ผ๋ก ์์ฑํ ์ ์์ต๋๋ค. ๋จ, ์ต์์ Instance ๊ฐ์ฒด๋ ์ง์ ์์ฑํ ์ ์์ต๋๋ค.
Properties
Parent
Instance
Parent ์์ฑ์ ํ์ฌ ์ธ์คํด์ค๊ฐ ๊ณ์ธต ๊ตฌ์กฐ์ ์ด๋ ์์น์ ์ํ๋์ง๋ฅผ ๊ฒฐ์ ํ๋ ํต์ฌ ์์ฑ์ ๋๋ค.
์ด ์์ฑ์ GetChildren(), FindFirstChild() ๋ฑ๊ณผ ๊ฐ์ ๊ตฌ์กฐ ํ์ ๋ฉ์๋์ ๊ธฐ๋ฐ์ด ๋ฉ๋๋ค.
๋ถ๋ชจ ๊ฐ์ฒด์ Destroy()๋ฅผ ํธ์ถํ๋ฉด ํด๋น ๋ถ๋ชจ์ ๊ทธ ํ์ ๋ชจ๋ ๊ฐ์ฒด์ Parent๊ฐ nil๋ก ์ค์ ๋๊ณ , ์ดํ Parent ์์ฑ์ ๋ณ๊ฒฝํ ์ ์๊ฒ ๋ฉ๋๋ค.
Clone()์ด๋ Instance.new()๋ก ์๋ก ์์ฑ๋ ๊ฐ์ฒด๋ ๊ธฐ๋ณธ์ ์ผ๋ก Parent๊ฐ nil์ธ ์ํ๋ก ๋ง๋ค์ด์ง๋๋ค. ์ด ์ํ์์๋ ํ๋ฉด์ ํ์๋์ง ์๊ฑฐ๋ ๋์ํ์ง ์์ผ๋ฉฐ, Parent๊ฐ ์ง์ ๋ ์ดํ์์ผ ๊ธฐ๋ฅํ๊ฑฐ๋ ๋ณด์ด๊ฒ ๋ฉ๋๋ค.
์๋ฒ์์ ์์ฑ๋ ๊ฐ์ฒด๋ ๋ณต์ (Replication) ๊ฐ๋ฅํ ๊ณ์ธต์ Parent๋ก ์ฐ๊ฒฐ๋๊ธฐ ์ ๊น์ง ํด๋ผ์ด์ธํธ๋ก ์ ์ก๋์ง ์์ต๋๋ค. ๊ฐ์ฒด๋ฅผ ๋ง๋ค๊ณ ์ฌ๋ฌ ์์ฑ์ ์ค์ ํ๋ ๊ฒฝ์ฐ, Parent ์์ฑ์ ๋ง์ง๋ง์ ์ง์ ํ๋ ๊ฒ์ด ๊ถ์ฅ๋ฉ๋๋ค.
Code Samples
local Part = Instance.new("Part")
local Workspace = game:GetService("Workspace")
Part.Parent = Workspace
print(Part.Parent)
Archivable
bool
ํ์ฌ ์ง์๋์ง ์์ต๋๋ค.
Code Samples
ClassName
string
ํ์ฌ ์ธ์คํด์ค๊ฐ ์ํ ํด๋์ค๋ฅผ ๋ฌธ์์ด๋ก ๋ํ๋ด๋ ์ฝ๊ธฐ ์ ์ฉ ์์ฑ์ ๋๋ค.
ํด๋น ๊ฐ์ฒด์ ํด๋์ค๋ฅผ ์ง์ ํ์ธํ๋ ๋ฐ ์ ์ฉํ๋ฉฐ, ์์ ๊ด๊ณ๋ฅผ ํฌํจํ ํ์ ํ๋ณ์ด ํ์ํ ๊ฒฝ์ฐ์๋ IsA() ๋ฉ์๋๋ฅผ ์ฌ์ฉํ๋ ๊ฒ์ด ์ข์ต๋๋ค.
Code Samples
local Part = script.Parent
print(Part.ClassName)
Name
string
์ธ์คํด์ค์ ์ด๋ฆ์ ์ง์ ํ๋ ์์ฑ์ ๋๋ค.
์ด ์ด๋ฆ์ ๊ณ์ธต ๊ตฌ์กฐ ๋ด์์ ์ธ์คํด์ค๋ฅผ ๊ตฌ๋ณํ๊ณ ์ ๋ฆฌํ๋ ๋ฐ ์ฌ์ฉ๋๋ฉฐ, ์คํฌ๋ฆฝํธ๋ฅผ ํตํด ํด๋น ๊ฐ์ฒด๋ฅผ ์ฐธ์กฐํ ๋๋ ํ์ฉ๋ฉ๋๋ค.
์คํฌ๋ฆฝํธ์์ ์ (.) ์ฐ์ฐ์๋ก ๊ฐ์ฒด์ ์ ๊ทผํ๋ ค๋ฉด ์ด๋ฆ์ด ๋ฐ๋์ ๋ฌธ์ ๋๋ ๋ฐ์ค(_)๋ก ์์ํด์ผ ํ๋ฉฐ, ์ดํ์๋ ๋ฌธ์, ์ซ์, ๋ฐ์ค๋ง ์ฌ์ฉํ ์ ์์ต๋๋ค. ์ด ๊ท์น์ ๋ฐ๋ฅด์ง ์์ผ๋ฉด ์ ํ๊ธฐ๋ฒ์ผ๋ก ์ ๊ทผํ ์ ์์ต๋๋ค.
๊ฐ์ ๊ณ์ธต์ ๋์ผํ ์ด๋ฆ์ ๊ฐ์ฒด๊ฐ ์กด์ฌํ๋ฉด, ํด๋น ์ด๋ฆ์ผ๋ก ์ ๊ทผ ์ ํ๋์ ๊ฐ์ฒด๋ง ๋ฐํ๋๋ฉฐ, ์ด๋ ์ํ๋ ๋์์ด ์๋ ์ ์์ต๋๋ค. ๋ฐ๋ผ์ ํน์ ๊ฐ์ฒด๋ฅผ ์ ํํ ์ฐธ์กฐํ๋ ค๋ฉด ๊ณ ์ ํ ์ด๋ฆ์ ์ง์ ํ๊ณ ์ค๋ณต์ ํผํ๋ ๊ฒ์ด ์์ ํฉ๋๋ค.
Code Samples
local Part = script.Parent
Part.Name = "NewPart"
ClientOnlyAttributes
InstanceAttributeArray
{Description Slot}
Code Samples
PendingAttributes
InstanceAttributeArray
{Description Slot}
Code Samples
EnabledMobility
bool
{Description Slot}
Code Samples
Methods
Clone
์ง์ ๋ ์ธ์คํด์ค์ ๊ทธ ํ์ ๋ชจ๋ ์์๋ฅผ ๋ณต์ ํ์ฌ, ์ต์์ ๋ณต์ ๋ณธ ์ธ์คํด์ค๋ฅผ ๋ฐํํฉ๋๋ค.
๋ฐํ๋ ์ธ์คํด์ค์ Parent ์์ฑ์ nil๋ก ์ค์ ๋ฉ๋๋ค.
Parameters
Return
Instance
๋ณต์ ๋ ์ธ์คํด์ค์ ๋๋ค.
Code Samples
local Workspace = game:GetService("Workspace")
local Part = Workspace.Part
local NewPart = Part:Clone()
NewPart.Position = Part.Position + Vector3.new(300, 0, 0)
NewPart.Parent = Workspace
Destroy
์ง์ ๋ ์ธ์คํด์ค์ ๊ทธ ํ์ ๋ชจ๋ ๊ฐ์ฒด์ Destroy()๋ฅผ ํธ์ถํ์ฌ ์์ ํ ์ ๊ฑฐํฉ๋๋ค.
Destroy()๊ฐ ์คํ๋ ์ธ์คํด์ค๋ Parent ์์ฑ์ด ์ ๊ฒจ ์ฌ์ฌ์ฉํ ์ ์์ผ๋ฏ๋ก, ๊ฐ์ฒด๋ฅผ ์์ ํ ์ญ์ ํ์ง ์๊ณ ์์๋ก ์ ๊ฑฐํ๋ ค๋ฉด Parent๋ฅผ nil๋ก ์ค์ ํ๋ฉด ๋ฉ๋๋ค.
์ด ๋ฉ์๋๋ ๋ถํ์ํ ๊ฐ์ฒด๋ฅผ ์ ๋ฆฌํ๋ ๋ฐ ์ฌ์ฉํ๋ ํต์ฌ ๋ฐฉ๋ฒ์ผ๋ก, ๋ชจ๋ ์ด๋ฒคํธ ์ฐ๊ฒฐ์ ํด์ ํ๊ณ ์ฌ์ฉํ์ง ์๋ ๊ฐ์ฒด๋ฅผ ์ ๊ฑฐํ์ฌ ๋ฉ๋ชจ๋ฆฌ ๋์์ ์ฅ๊ธฐ์ ์ธ ์ฑ๋ฅ ์ ํ๋ฅผ ํจ๊ณผ์ ์ผ๋ก ๋ฐฉ์งํฉ๋๋ค.
Destroy() ํธ์ถ ํ์๋ ํด๋น ๊ฐ์ฒด ๋๋ ํ์ ์์๋ฅผ ์ฐธ์กฐํ๋ ๋ณ์๋ฅผ ๋ฐ๋์ nil๋ก ์ด๊ธฐํํ์ฌ, ์ฝ๋์์ ์ด๋ฏธ ์ญ์ ๋ ๊ฐ์ฒด์ ์ ๊ทผํ๋ ์ํฉ์ ์๋ฐฉํ๋ ๊ฒ์ด ์ข์ต๋๋ค.
Parameters
Return
void
Code Samples
local Workspace = game:GetService("Workspace")
local Part = Workspace.Part
Part:Destroy()
FindFirstAncestor
์ง์ ๋ ์ธ์คํด์ค์ ์์ ๊ณ์ธต์ ๋ฐ๋ผ ์ฌ๋ผ๊ฐ๋ฉด์, ์ง์ ํ ์ด๋ฆ๊ณผ ๋์ผํ ์ด๋ฆ์ ๊ฐ์ง ๊ฐ์ง ์ฒซ ๋ฒ์งธ ์์ ์ธ์คํด์ค๋ฅผ ๋ฐํํฉ๋๋ค.
ํ์์ ํ์ฌ ์ธ์คํด์ค์ Parent๋ถํฐ ์์ํด DataModel๊น์ง ์งํ๋๋ฉฐ, ์กฐ๊ฑด์ ๋ง๋ ๊ฐ์ฒด๊ฐ ์์ผ๋ฉด nil์ด ๋ฐํ๋ฉ๋๋ค.
Parameters
string
InName
ํ์ํ ์์ ์ธ์คํด์ค์ ์ด๋ฆ์ ๋๋ค.
Return
Instance
ํ์๋ ์ธ์คํด์ค์ ๋๋ค.
Code Samples
local Part = script.Parent
local Ancestor = Part:FindFirstAncestor("ParentPart")
print(Ancestor)
FindFirstAncestorOfClass
์ง์ ๋ ์ธ์คํด์ค์ ์์ ๊ณ์ธต์ ๋ฐ๋ผ ์ฌ๋ผ๊ฐ๋ฉด์, ์ง์ ํ ํด๋์ค ์ด๋ฆ๊ณผ ๋์ผํ ์ด๋ฆ์ ๊ฐ์ง ๊ฐ์ง ์ฒซ ๋ฒ์งธ ์์ ์ธ์คํด์ค๋ฅผ ๋ฐํํฉ๋๋ค.
ํ์์ ํ์ฌ ์ธ์คํด์ค์ Parent๋ถํฐ ์์ํด DataModel๊น์ง ์งํ๋๋ฉฐ, ์กฐ๊ฑด์ ๋ง๋ ๊ฐ์ฒด๊ฐ ์์ผ๋ฉด nil์ด ๋ฐํ๋ฉ๋๋ค.
์ฃผ๋ก BasePart๊ฐ ํฌํจ๋ Model์ ์ฐพ์ ๋ ์ ์ฉํ๊ฒ ์ฐ์ ๋๋ค.
Parameters
string
InClassName
ํ์ํ ์์ ์ธ์คํด์ค์ ํด๋์ค ์ด๋ฆ์ ๋๋ค.
Return
Instance
ํ์๋ ์ธ์คํด์ค์ ๋๋ค.
Code Samples
local Part = script.Parent
local AncestorOfClass = Part:FindFirstAncestorOfClass("Model")
print(AncestorOfClass)
FindFirstAncestorWhichIsA
์ง์ ๋ ์ธ์คํด์ค์ ์์ ๊ณ์ธต์ ๋ฐ๋ผ ์ฌ๋ผ๊ฐ๋ฉด์, ์ง์ ํ ํด๋์ค ์ด๋ฆ์ ๋ํด Object:IsA()์ ๊ฒ์ฌ ๊ฒฐ๊ณผ๊ฐ true์ธ ์ฒซ ๋ฒ์งธ ์์ ์ธ์คํด์ค๋ฅผ ๋ฐํํฉ๋๋ค.
Instance:FindFirstAncestorOfClass()๊ฐ ํด๋์ค ์ด๋ฆ์ ์ ํํ ๋น๊ตํ๋ ๋ฐ๋ฉด, ์ด ๋ฉ์๋๋ ์์ ๊ด๊ณ๋ฅผ ๊ณ ๋ คํ๋ฏ๋ก MeshPart, Part์ฒ๋ผ BasePart๋ฅผ ์์ํ ๊ฐ์ฒด๋ผ๋ฉด ๋ชจ๋ ํ์ ๋์์ด ๋ฉ๋๋ค.
ํ์์ ํ์ฌ ์ธ์คํด์ค์ Parent๋ถํฐ ์์ํด DataModel๊น์ง ์งํ๋๋ฉฐ, ์กฐ๊ฑด์ ๋ง๋ ๊ฐ์ฒด๊ฐ ์์ผ๋ฉด nil์ด ๋ฐํ๋ฉ๋๋ค.
Parameters
string
InClassName
ํ์ํ ์์ ์ธ์คํด์ค์ ํด๋์ค ์ด๋ฆ์ ๋๋ค.
Return
Instance
ํ์๋ ์ธ์คํด์ค์ ๋๋ค.
Code Samples
local Part = script.Parent
local AncestorWhichIsA = Part:FindFirstAncestorWhichIsA("BasePart")
print(AncestorWhichIsA)
FindFirstChild
์ง์ ํ ์ด๋ฆ์ ์ฒซ ๋ฒ์งธ ์์ ์ธ์คํด์ค๋ฅผ ๋ฐํํ๋ฉฐ, ํด๋น ์ด๋ฆ์ ์์์ด ์์ผ๋ฉด nil์ ๋ฐํํฉ๋๋ค.
recursive ๊ฐ์ true๋ก ์ค์ ํ๋ฉด ์ง์ ์ ์ธ ์์๋ฟ ์๋๋ผ ๋ชจ๋ ํ์ ๊ณ์ธต๊น์ง ๊ฒ์ํ ์ ์์ต๋๋ค.
์ (.) ํ๊ธฐ๋ฒ์ผ๋ก ์์์ ์ฐธ์กฐํ ๋ ํด๋น ๊ฐ์ฒด๊ฐ ์กด์ฌํ์ง ์์ผ๋ฉด ์ค๋ฅ๊ฐ ๋ฐ์ํ์ง๋ง, FindFirstChild()๋ฅผ ์ฌ์ฉํ๋ฉด ์ค๋ฅ ์์ด ์์ ํ๊ฒ ์กด์ฌ ์ฌ๋ถ๋ฅผ ํ์ธํ ์ ์์ต๋๋ค. ์ด๋ฅผ ํ์ฉํ๋ฉด ํน์ Part๋ฅผ ์ฐพ๊ธฐ ์ ์ FindFirstChild()๋ก ์กด์ฌ ์ฌ๋ถ๋ฅผ ๋จผ์ ๊ฒ์ฌํ๊ณ , if ์กฐ๊ฑด๋ฌธ์ ํตํด ํ์ํ ์ฝ๋๋ฅผ ์คํํ ์ ์์ด ๋ณด๋ค ์์ ํฉ๋๋ค.
๋ค๋ง FindFirstChild()๋ ์ (.) ํ๊ธฐ๋ฒ๋ณด๋ค ์๋๊ฐ ๋๋ฆฌ๋ฏ๋ก, ์ฑ๋ฅ์ด ์ค์ํ ๋ฐ๋ณต๋ฌธ์ด๋ RunService ์ด๋ฒคํธ์ ์ฐ๊ฒฐ๋ ํจ์์์๋ ์ง์ ํธ์ถ์ ํผํ๊ณ ๊ฒฐ๊ณผ๋ฅผ ๋ณ์์ ์ ์ฅํ์ฌ ์ฌ์ฉํ๋ ๊ฒ์ด ๊ถ์ฅ๋ฉ๋๋ค.
Parameters
string
InName
ํ์ํ ํ์ ์ธ์คํด์ค์ ์ด๋ฆ์ ๋๋ค.
bool
recursive
ํ์ ๋ชจ๋ ์์๊น์ง ๊ฒ์ํ ์ง ์ฌ๋ถ๋ฅผ ์ง์ ํ๋ ์ต์ ์ ๋๋ค. (๊ธฐ๋ณธ๊ฐ: false)
Return
Instance
ํ์๋ ์ธ์คํด์ค์ ๋๋ค.
Code Samples
local Workspace = game:GetService("Workspace")
local Part = Workspace:FindFirstChild("Part")
print(Part)
FindFirstChildOfClass
์ง์ ๋ ์ธ์คํด์ค์ ์์ ์ค ํด๋์ค ์ด๋ฆ์ด ์ง์ ํ ๊ฐ๊ณผ ์ ํํ ์ผ์นํ๋ ์ฒซ ๋ฒ์งธ ๊ฐ์ฒด๋ฅผ ๋ฐํํ๋ฉฐ, ์กฐ๊ฑด์ ๋ง์กฑํ๋ ์์์ด ์์ผ๋ฉด nil์ ๋ฐํํฉ๋๋ค.
Parameters
string
InClassName
ํ์ํ ํ์ ์ธ์คํด์ค์ ํด๋์ค ์ด๋ฆ์ ๋๋ค.
bool
recursive
ํ์ ๋ชจ๋ ์์๊น์ง ๊ฒ์ํ ์ง ์ฌ๋ถ๋ฅผ ์ง์ ํ๋ ์ต์ ์ ๋๋ค. (๊ธฐ๋ณธ๊ฐ: false)
Return
Instance
ํ์๋ ์ธ์คํด์ค์ ๋๋ค.
Code Samples
local Workspace = game:GetService("Workspace")
local Part = Workspace:FindFirstChildOfClass("Part")
print(Part)
GetAttribute
์ธ์คํด์ค์์ ์ง์ ํ ์์ฑ ์ด๋ฆ์ ํด๋นํ๋ ๊ฐ์ ๋ฐํํ๋ฉฐ, ํด๋น ์์ฑ์ด ์์ผ๋ฉด nil์ ๋ฐํํฉ๋๋ค.
SetAttribute()๋ฅผ ์ฌ์ฉํ๋ฉด ์์ฑ ์ด๋ฆ๊ณผ ๊ฐ์ ์ง์ ํ์ฌ ์ค์ ํ ์ ์๊ณ , GetAttributes()๋ฅผ ์ฌ์ฉํ๋ฉด ์ธ์คํด์ค์ ๋ชจ๋ ์์ฑ๊ณผ ๊ฐ์ ๋์ ๋๋ฆฌ ํํ๋ก ๊ฐ์ ธ์ฌ ์ ์์ต๋๋ค.
Parameters
string
attribute
ํ์ธํ ์์ฑ ์ด๋ฆ์ ๋๋ค.
Return
Value
ํด๋น ์์ฑ์ ํ ๋น๋ ๊ฐ์ ๋๋ค.
Code Samples
local AttributeName = "Number"
local SetValue = 1
Part:SetAttribute(AttributeName, SetValue)
local GetValue = Part:GetAttribute(AttributeName)
print(GetValue)
GetAttributes
์ธ์คํด์ค์ ์ค์ ๋ ๋ชจ๋ ์์ฑ์ ํค-๊ฐ ์ ํํ์ ๋์ ๋๋ฆฌ๋ก ๋ฐํํฉ๋๋ค.
์ด ๋ฉ์๋๋ฅผ ์ฌ์ฉํ๋ฉด ์ธ์คํด์ค๊ฐ ๊ฐ์ง ๋ชจ๋ ์์ฑ๊ณผ ๊ทธ ๊ฐ์ ํ ๋ฒ์ ํ์ธํ ์ ์์ต๋๋ค.
Parameters
Return
Dictionary
์์ฑ์ ์ด๋ฆ๊ณผ ๊ฐ์ผ๋ก ๊ตฌ์ฑ๋ ๋์ ๋๋ฆฌ์ ๋๋ค.
Code Samples
Part:SetAttribute("Number", 1)
Part:SetAttribute("Text", "Hello")
local AttributeList = Part:GetAttributes()
for attributeName, attributeValue in pairs(AttributeList) do
print(attributeName, " : ", attributeValue)
end
GetAttributeChangedSignal
๋ชจ๋ ์์ฑ ๋ณํ๋ฅผ ๊ฐ์งํ๋ AttributeChanged ์ด๋ฒคํธ์ ๋ฌ๋ฆฌ, ์ด ๋ฉ์๋๋ ์ง์ ํ ์์ฑ์ด ๋ณ๊ฒฝ๋ ๋๋ง ๋์ํ๋ ์ด๋ฒคํธ๋ฅผ ๋ฐํํฉ๋๋ค.
Parameters
string
InAttributeName
๊ฐ ๋ณํ๋ฅผ ๊ฐ์งํ ์์ฑ์ ์ด๋ฆ์ ๋๋ค.
Return
ScriptSignal
์คํ๋ ์ด๋ฒคํธ์ ๋๋ค.
Code Samples
local Object = script.Parent
Object:GetAttributeChangedSignal("SomeEvent"):Connect(function()
print("Attribute Changed!")
end)
Object:SetAttribute("SomeEvent","test")
GetChildren
์ง์ ๋ ๊ฐ์ฒด๋ฅผ ๋ถ๋ชจ๋ก ๊ฐ์ง๋ ๋ชจ๋ ์ง์ ์์์ ๋ฐฐ์ด ํํ๋ก ๋ฐํํฉ๋๋ค.
๋ฐํ๋ ๋ฐฐ์ด์ ์ซ์ ์ธ๋ฑ์ค๋ฅผ ๊ฐ์ง๋ฉฐ, ์ผ๋ฐ for ๋ฃจํ๋ ์ซ์ for ๋ฃจํ๋ฅผ ์ฌ์ฉํด ์ํํ ์ ์๊ณ ๋ฐฐ์ด ๋ด ์์๋ค์ ์์๋ Parent ์์ฑ์ด ์ด ๊ฐ์ฒด๋ก ์ค์ ๋ ์์์ ๋ฐ๋ผ ์ ํด์ง๋๋ค.
๋ชจ๋ ํ์ ์์๋ฅผ ๊ฐ์ ธ์ค๋ ค๋ฉด GetDescendants() ๋ฉ์๋๋ฅผ ์ฌ์ฉํ๋ฉด ๋ฉ๋๋ค.
Parameters
Return
Array
์์ ์ธ์คํด์ค๋ก ๊ตฌ์ฑ๋ ๋ฐฐ์ด์ ๋๋ค.
Code Samples
local Workspace = game:GetService("Workspace")
local Children = Workspace:GetChildren()
for _, child in ipairs(Children) do
print(child.Name)
end
GetChildrenNum
์ง์ ๋ ๊ฐ์ฒด๋ฅผ ๋ถ๋ชจ๋ก ๊ฐ์ง๋ ๋ชจ๋ ์ง์ ์์์ ์๋ฅผ ๋ฐํํฉ๋๋ค.
Parameters
Return
number
์์ ์ธ์คํด์ค์ ์์ ๋๋ค.
Code Samples
local Object = script.Parent
print(Object:GetChildrenNum())
GetDescendants
์ง์ ๋ ๊ฐ์ฒด์ ๋ชจ๋ ํ์ ๊ณ์ธต์ ๋ฐฐ์ด ํํ๋ก ๋ฐํํฉ๋๋ค.
GetChildren()์ด ํ์์ ์๋ ์ง์ ์ ์ธ ์์๋ง ๊ฐ์ ธ์ค๋ ๊ฒ๊ณผ ๋ฌ๋ฆฌ, ์ด ๋ฉ์๋๋ ์์๋ฟ ์๋๋ผ ๊ทธ ํ์ ์์๊น์ง ๋ชจ๋ ๊ฒ์ํ์ฌ ํฌํจํฉ๋๋ค.
Parameters
Return
array
์์ ์ธ์คํด์ค์ ํ์ ํญ๋ชฉ์ ๋ชจ๋ ํฌํจํ ๋ฐฐ์ด์ ๋๋ค.
Code Samples
local Workspace = game:GetService("Workspace")
local Descendants = Workspace:GetDescendants()
for _, descendant in ipairs(Descendants) do
print(descendant.Name)
end
IsDescendantOf
ํ์ฌ ์ธ์คํด์ค๊ฐ ์ง์ ๋ ์์ ๊ฐ์ฒด์ ํ์ ๊ณ์ธต์ ํฌํจ๋์ด ์์ผ๋ฉด true๋ฅผ ๋ฐํํฉ๋๋ค.
Parameters
Instance
InAncestor
ํ์ธํ ์กฐ์ ์ธ์คํด์ค์ ๋๋ค.
Return
bool
์กฐ์์ ํ์ ๊ณ์ธต์ ํฌํจ๋์ด ์๋์ง ์ฌ๋ถ์ ๋๋ค.
Code Samples
local Workspace = script.Parent.Parent
local Part = script.Parent
local IsDescendantOf = script:IsDescendantOf(Workspace)
print(IsDescendantOf)
IsA
ํ์ฌ ์ธ์คํด์ค๊ฐ ์ง์ ๋ ํด๋์ค์ด๊ฑฐ๋ ํด๋น ํด๋์ค๋ฅผ ์์๋ฐ์ ๊ฒฝ์ฐ true๋ฅผ ๋ฐํํฉ๋๋ค.
์ด ๋ฉ์๋๋ ํนํ ๊ฐ์ฒด๊ฐ ํน์ ํํธ ๊ณ์ด์ ์ํ๋์ง ํ๋ณํ ๋ ์ ์ฉํฉ๋๋ค. ์๋ฅผ ๋ค์ด, Part๋ MeshPart์ฒ๋ผ BasePart๋ฅผ ์์๋ฐ์ ๊ฐ์ฒด์ธ์ง ํ์ธํ๋ ค๋ฉด GetChildren()์ผ๋ก ๋ชจ๋ ์์์ ๊ฐ์ ธ์จ ๋ค IsA()๋ก ๊ฒ์ฌํ ์ ์์ต๋๋ค.
์์ ๊ด๊ณ๋ฅผ ํฌํจํ ํ์ ํ๋ณ์ ์ ํฉํ๋ฉฐ, ์์ ๊ด๊ณ๋ฅผ ๋ฌด์ํ๋ ค๋ฉด ClassName ์์ฑ์ผ๋ก ์ง์ ๋น๊ตํ๋ ๊ฒ์ด ์ข์ต๋๋ค.
๋ํ number๋ string๊ณผ ๊ฐ์ Luau ๊ธฐ๋ณธ ๋ฐ์ดํฐ ํ์ ์ type() ๋๋ typeof() ํจ์๋ฅผ ์ฌ์ฉํด ํ์ธํด์ผํฉ๋๋ค.
Parameters
string
InClassName
ํ์ํ ํด๋์ค ์ด๋ฆ์ ๋๋ค.
Return
bool
ํฌํจ ์ฌ๋ถ์ ๋๋ค.
Code Samples
local Part = script.Parent
print("Instance : ", Part:IsA("Instance")) -- true
print("Part : ", Part:IsA("BasePart")) -- true
print("BasePart : ", Part:IsA("BasePart")) -- true
print("MeshPart : ", Part:IsA("MeshPart")) -- false
if Part:IsA("Part") then
print("Part")
else
end
SetAttribute
ํ์ฌ ์ธ์คํด์ค์ ์ง์ ํ ์ด๋ฆ์ ์์ฑ ๊ฐ์ ์ค์ ํฉ๋๋ค.
์์ฑ ์ด๋ฆ์๋ ์๋ฌธ์, ์ซ์, ๋ฐ์ค(_)๋ง ์ฌ์ฉํ ์ ์์ผ๋ฉฐ, ๊ณต๋ฐฑ์ด๋ ํน์๋ฌธ์๋ ํ์ฉ๋์ง ์๊ณ , ๊ฐ์ด nil๋ก ์ฃผ์ด์ง๋ฉด ํด๋น ์์ฑ์ ์ญ์ ๋ฉ๋๋ค.
string, number, boolean ๊ฐ์ Luau์ ๊ธฐ๋ณธ ๋ฐ์ดํฐ ํ์ ๋ฟ ์๋๋ผ Instance, CFrame ๋ฑ ๋ค์ํ ํ์ ์ ์ง์ํ์ง๋ง, ์ง์๋์ง ์๋ ํ์ ์ผ๋ก ์์ฑ์ ์ค์ ํ๋ฉด ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค.
์๋ฒ์์ ์ค์ ํ ๊ฐ์ ํด๋ผ์ด์ธํธ๋ก ์๋ ๋ณต์ ๋๋ฉฐ, ์ด๋ฅผ ํ์ฉํ๋ฉด RemoteEvent๋ฅผ ์ฌ์ฉํ์ง ์๊ณ ๋ ์คํฌ๋ฆฝํธ ๊ฐ ํต์ ์ด ๊ฐ๋ฅํฉ๋๋ค.
Attribute๋ Value ์ค๋ธ์ ํธ์ฒ๋ผ ๋ณ๋์ ์ธ์คํด์ค๋ฅผ ์์ฑํ๊ฑฐ๋ ํ๊ดดํ์ง ์์ผ๋ฏ๋ก Instance.new()๋ Destroy()์ ๋นํด ํจ์ฌ ๋น ๋ฅด๊ฒ ์ฒ๋ฆฌ๋๋ฉฐ, ํนํ ๋ค์์ ์ค๋ธ์ ํธ์ ๊ฐ์ ๋์ ์ผ๋ก ์์ฑํ๊ฑฐ๋ ์ ๊ฑฐํด์ผ ํ๋ ์ํฉ๊ณผ ๊ฐ์ด ๊ณ ๋น๋ ์ฒ๋ฆฌ, ๋๋ ์ค๋ธ์ ํธ ์ ์ด, ๋ฐ๋ณต์ ์ธ ๋๊ธฐํ๊ฐ ํ์ํ ๊ฒฝ์ฐ์ ์ ๋ฆฌํฉ๋๋ค.
ํน์ ์ด๋ฆ์ ์์ฑ์ ๊ฐ์ ธ์ค๋ ค๋ฉด GetAttribute()๋ฅผ, ๋ชจ๋ ์์ฑ์ ๊ฐ์ ธ์ค๋ ค๋ฉด GetAttributes()๋ฅผ ์ฌ์ฉํ๋ฉด ๋ฉ๋๋ค.
Parameters
string
attribute
์ค์ ํ ์์ฑ์ ์ด๋ฆ์ ๋๋ค.
Value
value
ํ ๋นํ ๊ฐ์ ๋๋ค.
Return
void
Code Samples
local AttributeName = "Number"
local SetValue = 1
Part:SetAttribute(AttributeName, SetValue)
WaitForChild
์ง์ ํ ์ด๋ฆ์ ์์ ์ธ์คํด์ค๋ฅผ ๋ฐํํ๋ฉฐ, ์กด์ฌํ์ง ์์ผ๋ฉด ํด๋น ๊ฐ์ฒด๊ฐ ์์ฑ๋ ๋๊น์ง ์คํ์ ์ผ์ ์ค๋จํฉ๋๋ค.
timeOut ๊ฐ์ ์ง์ ํ๋ฉด ์ค์ ๋ ์๊ฐ(์ด)๋ง ๋๊ธฐํ ํ, ์ฌ์ ํ ํด๋น ์์์ด ์์ผ๋ฉด nil์ ๋ฐํํฉ๋๋ค. timeOut ์์ด 5์ด ์ด์ ๋๊ธฐํ๋ฉด ๋ฌดํ ๋๊ธฐ ๊ฐ๋ฅ์ฑ์ ์๋ฆฌ๋ ๊ฒฝ๊ณ ๋ฉ์์ง๊ฐ ์ถ๋ ฅ๋ฉ๋๋ค.
์๋ฒ์์ ํด๋ผ์ด์ธํธ๋ก ๊ฐ์ฒด๊ฐ ์ ์ก๋๋ ์์ ๊ณผ ์์๋ ๋ณด์ฅ๋์ง ์์ผ๋ฏ๋ก, ๋ก๋ ์์๋ก ์ธํ ์ฐธ์กฐ ์คํจ๋ฅผ ๋ฐฉ์งํ๊ธฐ ์ํด LocalScript์์ ํด๋ผ์ด์ธํธ ์ธก ๊ฐ์ฒด๋ฅผ ๋ค๋ฃฐ ๋ ํ์์ ์ผ๋ก ์ฌ์ฉ๋ฉ๋๋ค.
Parameters
string
InChildName
ํ์ํ ํ์ ์ธ์คํด์ค์ ์ด๋ฆ์ ๋๋ค.
number
InTimeOut
๋๊ธฐํ ์ต๋ ์๊ฐ(์ด)์ ๋๋ค. ์๋ตํ๋ฉด ํด๋น ๊ฐ์ฒด๊ฐ ์กด์ฌํ ๋๊น์ง ๊ณ์ ๋๊ธฐํฉ๋๋ค.
Return
Instance
ํ์๋ ์ธ์คํด์ค์ ๋๋ค.
Code Samples
local Workspace = game:GetService("Workspace")
local Part = Workspace:WaitForChild("Part")
print(Part)
AddTag
ํ์ฌ ์ธ์คํด์ค์ ์ง์ ํ ์ด๋ฆ์ ํ๊ทธ๋ฅผ ์ถ๊ฐํฉ๋๋ค.
Parameters
FName
tag
์ง์ ํ ํ๊ทธ์ ์ด๋ฆ์ ๋๋ค.
Return
void
Code Samples
Part:AddTag("SomeTag")
RemoveTag
ํ์ฌ ์ธ์คํด์ค์ ์ง์ ํ ์ด๋ฆ์ ํ๊ทธ๋ฅผ ์ญ์ ํ๋ฉฐ, ํด๋น ํ๊ทธ๊ฐ ์กด์ฌํ์ง ์์๋ ์ค๋ฅ ์์ด ๋์ํฉ๋๋ค.
Parameters
FName
tag
์ญ์ ํ ํ๊ทธ์ ์ด๋ฆ์ ๋๋ค.
Return
void
Code Samples
Part:RemoveTag("SomeTag")
HasTag
ํ์ฌ ์ธ์คํด์ค์ ์ง์ ํ ์ด๋ฆ์ ํ๊ทธ๊ฐ ์ถ๊ฐ๋์ด ์์ผ๋ฉด true๋ฅผ ๋ฐํํฉ๋๋ค.
Parameters
FName
tag
ํ์ธํ ํ๊ทธ์ ์ด๋ฆ์ ๋๋ค.
Return
bool
ํ๊ทธ์ ์กด์ฌ ์ฌ๋ถ์ ๋๋ค.
Code Samples
if Part:HasTag("SomeTag") then
else
end
GetTags
ํ์ฌ ์ธ์คํด์ค์ ์ ์ฉ๋ ํ๊ทธ ๋ชฉ๋ก์ ๋ฌธ์์ด ๋ฐฐ์ด๋ก ๋ฐํํฉ๋๋ค.
ํน์ ํ๊ทธ๋ง ํ์ธํ๋ HasTag()์ ๋ฌ๋ฆฌ, ์ธ์คํด์ค์ ์ ์ฉ๋ ๋ชจ๋ ํ๊ทธ๋ฅผ ์กฐํํ ๋ ์ ํฉํฉ๋๋ค.
Parameters
Return
Array
๋ฌธ์์ด๋ก ๊ตฌ์ฑ๋ ๋ฐฐ์ด์ ๋๋ค.
Code Samples
Part:AddTag("SomeTag")
local Tags = Part:GetTags()
for i = 1, #Tags do
print(Tags[i])
end
Events
AncestryChanged
ํ์ฌ ์ธ์คํด์ค ๋๋ ์์ ์ธ์คํด์ค์ Parent ์์ฑ์ด ๋ณ๊ฒฝ๋ ๋ ์คํ๋๋ ์ด๋ฒคํธ์ ๋๋ค.
ํ์ ์ธ์คํด์ค์ Parent ์์ฑ์ด ๋ณ๊ฒฝ๋ ๋๋ ์คํ๋์ง ์์ต๋๋ค.
Parameters
Instance
child
Parent ์์ฑ์ด ๋ณ๊ฒฝ๋ ์ธ์คํด์ค์ ๋๋ค.
Instance
parent
๋ณ๊ฒฝ๋ Parent ๊ฐ์ ๋๋ค.
Code Samples
local Part = Instance.new("Part")
local function OnAncestryChanged(child, parent)
print(child, "Ancestry Changed:", parent)
end
Part.AncestryChanged:Connect(OnAncestryChanged)
wait(2)
Part.Parent = game.Workspace
AttributeChanged
ํ์ฌ ์ธ์คํด์ค์์ ์์ฑ์ด ๋ณ๊ฒฝ๋ ๋๋ง๋ค ์คํ๋๋ ์ด๋ฒคํธ๋ก, ์์ฑ์ด nil๋ก ์ค์ ๋๋ ๊ฒฝ์ฐ๋ ๊ฐ์งํฉ๋๋ค.
์ง์ ํ ์์ฑ๋ง ๊ฐ์งํ๋ GetAttributeChangedSignal()์ ๋ฌ๋ฆฌ ๋ชจ๋ ์์ฑ ๋ณํ๋ฅผ ๊ฐ์งํ๋ฉฐ, ์ด๋ฒคํธ๊ฐ ์คํ๋๋ฉด ๋ณ๊ฒฝ๋ ์์ฑ์ ์ด๋ฆ์ด ์ฐ๊ฒฐ๋ ํจ์๋ก ์ ๋ฌ๋ฉ๋๋ค.
Parameters
string
attribute
๋ณ๊ฒฝ๋ ์์ฑ์ ์ด๋ฆ์ ๋๋ค.
Code Samples
local Part = script.Parent
local function OnAttributeChanged(attribute)
print(attribute, "Changed:", Part:GetAttribute(attribute))
end
Part.AttributeChanged:Connect(OnAttributeChanged)
wait(2)
Part:SetAttribute("Color", "Blue")
Changed
ํ์ฌ ์ธ์คํด์ค์์ ํ๋กํผํฐ๊ฐ ๋ณ๊ฒฝ๋ ๋๋ง๋ค ์คํ๋๋ ์ด๋ฒคํธ์ ๋๋ค.
๋ณ๊ฒฝ๋ ๊ฐ์ object[property] ํํ๋ก ์ง์ ์กฐํํ ์ ์์ต๋๋ค.
์ฃผ๋ก ์คํฌ๋ฆฝํธ์ ์ํ ํ๋กํผํฐ ๋ณํ๋ฅผ ๊ฐ์งํ๋ ๋ฐ ์ฌ์ฉ๋๋ฉฐ, ๋ฌผ๋ฆฌ ์์ง์ ์ํด CFrame์ด๋ Position ๋ฑ์ด ๋ณ๊ฒฝ๋๋ ๊ฒฝ์ฐ์๋ ์คํ๋์ง ์์ต๋๋ค.
๋ํ ๋ณ๊ฒฝ ์ฃผ๊ธฐ๊ฐ ๋งค์ฐ ์งง์ ์์ฑ์ ์ผ๋ถ ๋ณ๊ฒฝ์ ๊ฐ์งํ์ง ๋ชปํ๊ฑฐ๋ ์ด๋ฒคํธ๊ฐ ๋ฐ์ํ์ง ์์ ์ ์์ผ๋ฏ๋ก, ๊ฒ์ ๋ก์ง์์ ์ค์ํ ์์ฑ์ธ ๊ฒฝ์ฐ, ์ง์ ์กฐํ๋ฅผ ํตํด ๋์์ ์ถฉ๋ถํ ๊ฒ์ฆํ๋ ๊ฒ์ด ์ข์ต๋๋ค.
Parameters
string
property
๋ณ๊ฒฝ๋ ํ๋กํผํฐ์ ์ด๋ฆ์ ๋๋ค.
Code Samples
local Part = script.Parent
local function OnChanged(property)
print(property, "Changed:", Part[property])
end
Part.Changed:Connect(OnChanged)
wait(2)
Part.Name = "MyPart"
ChildAdded
ํด๋น ์ธ์คํด์ค์ ์์ ์ธ์คํด์ค๊ฐ ์ถ๊ฐ๋ ๋ ์คํ๋๋ ์ด๋ฒคํธ์ ๋๋ค.
์ด ์ด๋ฒคํธ๋ ์ง์ ์ ์ธ ์์๋ง ๊ฐ์งํ๋ฉฐ, ์ ์ฒด ํ์ ๊ณ์ธต์ ์ถ๊ฐ๋ฅผ ๊ฐ์งํ๋ ค๋ฉด DescendantAdded ์ด๋ฒคํธ๋ฅผ ์ฌ์ฉํด์ผ ํฉ๋๋ค.
๋ํ ์๋ฒ์์ ์์ฑ๋ ๊ฐ์ฒด๋ฅผ ํด๋ผ์ด์ธํธ์์ ๊ฐ์งํ๋ ๊ฒฝ์ฐ, ํด๋น ๊ฐ์ฒด์ ํ์ ์์๋ฅผ ๋ค๋ฃฐ ๋๋ ๋ฐ๋์ WaitForChild()๋ฅผ ์ฌ์ฉํด์ผ ํฉ๋๋ค. ์ด๋ ์๋ฒ์ ํด๋ผ์ด์ธํธ ๊ฐ ๋๊ธฐํ ์ ๊ฐ์ฒด์ ๊ทธ ํ์ ์์๊ฐ ๋์์ ์ ์ก๋๋ค๋ ๋ณด์ฅ์ด ์๊ธฐ ๋๋ฌธ์ ๋๋ค.
Parameters
Instance
child
์ถ๊ฐ๋ ์์ ์ธ์คํด์ค์ ์ด๋ฆ์ ๋๋ค.
Code Samples
local Part = script.Parent
local function OnChildAdded(child)
print("Child Added:", child)
end
Part.ChildAdded:Connect(OnChildAdded)
wait(2)
local ChildPart = Instance.new("Part")
ChildPart.Name = "ChildPart"
ChildPart.Parent = Part
ChildRemoved
ํด๋น ์ธ์คํด์ค์ ์์ ์ธ์คํด์ค๊ฐ ์ ๊ฑฐ๋ ๋ ์คํ๋๋ ์ด๋ฒคํธ์ ๋๋ค.
์์์ Parent ์์ฑ์ด ๋ค๋ฅธ ์ธ์คํด์ค๋ก ๋ณ๊ฒฝ๋๊ฑฐ๋, Destroy() ๋ฉ์๋๋ฅผ ํธ์ถํด ์ญ์ ๋ ๊ฒฝ์ฐ์๋ ์คํ๋ฉ๋๋ค.
์ด ์ด๋ฒคํธ๋ ์ง์ ์ ์ธ ์์๋ง ๊ฐ์งํ๋ฉฐ, ์ ์ฒด ํ์ ๊ณ์ธต์ ์ ๊ฑฐ๋ฅผ ๊ฐ์งํ๋ ค๋ฉด DescendantRemoving ์ด๋ฒคํธ๋ฅผ ์ฌ์ฉํด์ผ ํฉ๋๋ค.
Parameters
Instance
child
์ ๊ฑฐ๋ ์์ ์ธ์คํด์ค์ ์ด๋ฆ์ ๋๋ค.
Code Samples
DescendantAdded
ํด๋น ์ธ์คํด์ค์ ์์ ์ธ์คํด์ค๊ฐ ์ถ๊ฐ๋ ๋ ์คํ๋๋ ์ด๋ฒคํธ์ ๋๋ค.
์ด ์ด๋ฒคํธ๋ ๋ชจ๋ ์์ ๊ฐ์ฒด์ ๋ํด ์คํ๋๋ฏ๋ก, ์ด๋ค ๊ฐ์ฒด๋ฅผ ์ธ์คํด์ค์ ์์์ผ๋ก ๋ฐฐ์นํ๋ฉด ๊ทธ ๊ฐ์ฒด๋ฟ ์๋๋ผ ๊ทธ ๊ฐ์ฒด๊ฐ ํฌํจํ๋ ๋ชจ๋ ํ์ ๊ฐ์ฒด์ ๋ํด ๊ฐ๋ณ์ ์ผ๋ก ์ด๋ฒคํธ๊ฐ ๋ฐ์ํฉ๋๋ค.
์ง์ ์ ์ธ ์์๋ง ๊ฐ์งํ๋ ค๋ฉด ChildAdded ์ด๋ฒคํธ๋ฅผ ์ฌ์ฉํ์ธ์.
Parameters
Instance
descendant
์ถ๊ฐ๋ ์์ ์ธ์คํด์ค์ ์ด๋ฆ์ ๋๋ค.
Code Samples
local Part = script.Parent
local function OnDescendantAdded(descendant)
print("Descendant Added:", descendant)
end
Part.DescendantAdded:Connect(OnDescendantAdded)
wait(2)
local ChildPart = Instance.new("Part")
ChildPart.Name = "ChildPart"
ChildPart.Parent = Part
DescendantRemoving
ํด๋น ์ธ์คํด์ค์ ์์ ์ธ์คํด์ค๊ฐ ์ ๊ฑฐ๋๊ธฐ ์ง์ ์ ์คํ๋๋ ์ด๋ฒคํธ์ ๋๋ค.
์์์ Parent ์์ฑ์ด ๋ค๋ฅธ ์ธ์คํด์ค๋ก ๋ณ๊ฒฝ๋๊ฑฐ๋, Destroy() ๋ฉ์๋๋ฅผ ํธ์ถํด ์ญ์ ๋ ๊ฒฝ์ฐ์๋ ์คํ๋ฉ๋๋ค.
์ด ์ด๋ฒคํธ๋ ๋ชจ๋ ํ์ ๊ณ์ธต์ ๋ํด ๊ฐ๋ณ์ ์ผ๋ก ์คํ๋๋ฏ๋ก, ์ด๋ค ๊ฐ์ฒด๊ฐ ์ ๊ฑฐ๋ ๋ ๊ทธ ๊ฐ์ฒด๋ฟ ์๋๋ผ ๊ทธ ๊ฐ์ฒด์ ๋ชจ๋ ํ์ ๊ฐ์ฒด์ ๋ํด์๋ ์์ฐจ์ ์ผ๋ก ํธ์ถ๋ฉ๋๋ค. ๋ง์ฝ ์ ๊ฑฐ๋๋ ๊ฐ์ฒด๊ฐ ์ง์ ์์์ด๋ผ๋ฉด, ์ด ์ด๋ฒคํธ๋ ChildRemoved ์ด๋ฒคํธ๋ณด๋ค ๋จผ์ ์คํ๋ฉ๋๋ค.
์ด ์์ ์์๋ ์์์ ๋ถ๋ชจ ์์ฑ์ด ์์ง ๋ณ๊ฒฝ๋์ง ์์ ์ํ์ด๋ฉฐ, Parent๋ฅผ ๋ค๋ฅธ ์ธ์คํด์ค๋ก ๋ณ๊ฒฝํ๋ ๊ฒ์ ๋ถ๊ฐ๋ฅํฉ๋๋ค.
์ง์ ์ ์ธ ์์๋ง ๊ฐ์งํ๋ ค๋ฉด ChildRemoved ์ด๋ฒคํธ๋ฅผ ์ฌ์ฉํ์ธ์.
Parameters
Instance
descendant
์ ๊ฑฐ๋ ์์ ์ธ์คํด์ค์ ์ด๋ฆ์ ๋๋ค.
Code Samples
Destroying
ํด๋น ์ธ์คํด์ค๊ฐ Destroy() ๋ฉ์๋์ ์ํด ์ญ์ ๋ ๋ ์คํ๋๋ ์ด๋ฒคํธ์ ๋๋ค.
์ด๋ฒคํธ์ ์ฐ๊ฒฐ๋ ์ฝ๋ฐฑ ํจ์๊ฐ ์ธ์คํด์ค๋ฅผ ์ฐธ์กฐํ๊ณ ์๋ ๋์์๋ ํด๋น ์ธ์คํด์ค๊ฐ ๋ฉ๋ชจ๋ฆฌ์์ ํด์ ๋์ง ์์ผ๋ฏ๋ก, ์์ ํ๊ฒ ๊ฐ์ฒด์ ์ ๊ทผํ ์ ์์ต๋๋ค.
Parameters
Code Samples
local Part = script.Parent
local function OnDestroying()
print(Part, "is being destroyed.")
end
Part.Destroying:Connect(OnDestroying)
wait(2)
Part:Destroy()
Last updated