ItemAdded (Event): Difference between revisions
From Goodblox Wiki
Jump to navigationJump to search
(created the page) |
m (→Example) |
||
(One intermediate revision by the same user not shown) | |||
Line 6: | Line 6: | ||
|object = [[GBX.lua.CollectionService (Service)|CollectionService]] | |object = [[GBX.lua.CollectionService (Service)|CollectionService]] | ||
}}</onlyinclude> | }}</onlyinclude> | ||
==Example== | |||
<pre> | |||
game:GetService("CollectionService").ItemAdded:connect(function(instance) | |||
print(instance.className.." added to DataModel") | |||
end) | |||
Instance.new("Part", workspace) --// Doesn't fire because CollectionService doesn't watch Parts | |||
Instance.new("Configuration", workspace) --> Configuration added to DataModel | |||
</pre> | |||
[[Category:Events]] | [[Category:Events]] |
Latest revision as of 03:03, 25 September 2021
Event | |
---|---|
Syntax | ItemAdded( Instance instance ) |
Description: | This function fires when a Configuration or VehicleSeat is added to the DataModel. |
In Object: | CollectionService |
Example
game:GetService("CollectionService").ItemAdded:connect(function(instance) print(instance.className.." added to DataModel") end) Instance.new("Part", workspace) --// Doesn't fire because CollectionService doesn't watch Parts Instance.new("Configuration", workspace) --> Configuration added to DataModel