Instance tagging is really helpful and should be used in places where it can.
Example:
A game I develop utilizes a system where players are able to pick up an object and click the pedestal again to place it back.
To check for when the tool is gone, I have to write long lines of code to accommodate for when the player leaves, health reaches zero or does something else with the tool. Now all I need to do is add a tag and it does everything for me - when the tool is removed from the player’s character via death, removal or leaving, it automatically tells me “instance is gone” and then I can run my functions again to replace it.
(sorry if that was confusing ^ I wrote this while the sky was dark if you know what I mean intensive winking)
local CS = game:GetService("CollectionService")
local function Added(part)
if not part:IsA("BasePart") then return end
part.Touched:connect(function(p)
p:BreakJoints() -- Just a demo
end)
end
for k,v in pairs(CS:GetTagged("Kill")) do Added(v) end
CS:GetInstanceAddedSignal("Kill"):Connect(Added)
Builders just have to use the convenient Studio UI (in this case still the plugin) to add a tag to the part. They don’t need to code, add StringValues named “Kill” or parent the part to Workspace.Kill, they just need to add the Kill tag and bam.
Scripters don’t have to scan through the whole workspace (and listen to DescendantAdded) looking for parts in Workspace.Kill or parts with a StringValue named “Kill” inside or whatever. They just need to use the convenient tag API.
Seems like they only replicate when the instance fully replicates, not when altered after that. Similar to (the children of) Terrain (unless that changed). I don’t expect Client2Server with FE, but at least Server2Client. (I tested this with FE false, as that’s apparently the default when I create a new place, and didn’t check until after the test)
Good point. However, I don’t think there is a need for this API. One can just grab the collection and pass it into the whitelist / blacklist as is (Use the version with IgnoreList). You shouldn’t have to be parenting things right now anyway.