OnChildAdded||doc136712

September 20, 2022

Format

local event = Instance:GetEvent("OnChildAdded")

Describe

Triggered after adding child nodes to the instance

Callback function parameters

Type name introduce
Instance instance Current instance
Instance child Added child node instances

Code example

local map = World:GetStaticMap("map001")
local part = Instance.new("Part", map.Root)

local event = part:GetEvent("OnChildAdded")
event:Bind(function(instance, child)
    print("add child!", instance, child)
end)

Instance.new("Part", part)