Construction Script Question

I need to take away segments. Think it will work the same way? Also, have any thoughts on how to make that function?