Best way to control something in workspace when using a remote event?

I’ve made a custom click detector where there is a remote event fired from a local script in StarterGui and the handler for the remote event firing is a server script.

What would be the best way to control an object in the workspace with this, when there will be multiple objects with the same names? (Doors, other prompts, etc)

You should either give instances different names or if you want the action to be performed on all instances of a particular name then iterate over those instances, locate the ones which match and act on those specifically.

I don’t think this would be practical for doors, and it’s not the best way to do it.

It was a little hard to understand what you were explaining in the original post.

CollectionService specifically CollectionService:AddTag obviously you can’t tell what door is which if they are all the same so you need some why to identify them and with CollectionService you can assign unique tags to each door.

You could also make them different colors but if you can’t change stuff like that CollectionService is the best way.

Edit: If they are in workspace you could just have the client pass the door as a argument to the remote event.

1 Like

Juat to add to @anthropomorphic_dev’s post, using a Tag Editor Plugin is an easier way to manipulate collectionservc.


Passing it in the remote event works well, will also use it for other prompts like equipping clothing, thanks!