This can be stated as an indirect quote. Alternate translation: "Then Moses stood at the entrance to the camp and said that whoever was on Yahweh's side should come to him" (See: [[rc://en/ta/man/translate/figs-quotations]])
Moses speaks of being loyal to Yahweh as being on Yahweh's side. Alternate translation: "Whoever is loyal to Yahweh" or "Whoever serves Yahweh" (See: [[rc://en/ta/man/translate/figs-metaphor]])