ItemRemoved (Event): Difference between revisions

From Goodblox Wiki
Jump to navigationJump to search
(created the page)
 
 
(2 intermediate revisions 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").ItemRemoved:connect(function(instance)
    print(instance.className.." removed from the DataModel")
end)
Instance.new("Part", workspace):Remove() --// Doesn't fire because CollectionService ignores Parts
Instance.new("Configuration", Workspace):Destroy() --> Configuration removed from the DataModel
</pre>


[[Category:Events]]
[[Category:Events]]

Latest revision as of 03:02, 25 September 2021

Event
Syntax ItemRemoved( Instance instance )
Description: This function fires when a Configuration or VehicleSeat is removed from the DataModel.
In Object: CollectionService


Example

game:GetService("CollectionService").ItemRemoved:connect(function(instance)
     print(instance.className.." removed from the DataModel")
end)
 
Instance.new("Part", workspace):Remove() --// Doesn't fire because CollectionService ignores Parts
Instance.new("Configuration", Workspace):Destroy() --> Configuration removed from the DataModel