Can you reuse remote events/functions?

Can you reuse remote events/functions? Or should you make separate for each script?

1 Like

You can reuse RemoteEvents (receive fired signals from multiple scripts), however, you can only have one script connected to a RemoteFunction at a time (Multiple scripts can still invoke it).

So what if 2 people press a button at exactly the same time? Or do you just mean you can only run 1 function on the server script?

If 2 people pressed a button at exactly the same time, the remote event would still work, but depending if you have debounce or not, it will either fire the event twice or run only once. If you want only one event, a debounce will help.

Same thing with RemoteFunctions.

I want both players to run the function, so in this case I don’t need any boolean?

Yes, you can have both players run the function no matter what, and without the boolean, they can both activate the function.

1 Like

To add onto what everyone else said, it depends what you mean by “reuse.” If you mean you want to make it so that if it’s fired once, one thing would happen, and the next time it fires, the opposite or something else happens, you can use an elseif statement. It is a common practice for me.