I am pretty new to using CollectionService, I already got a tag for the parts, I just wanna know, how would I be able to destroy those parts with the tag? I can't figure it out. Any help is appreciated
The CollectionService:GetTagged()
function allows you to retrieve all the instances with a certain tag. It returns a table, through which you can iterate through (usually by a for loop) and do what you want to each instance.
For example:
local CollectionService = game:GetService("CollectionService") local tagged = CollectionService:GetTagged("tag") for index, value in pairs(tagged) do print(value.Name) end
Or in your case, you replace line five with value:Destroy()
.