I made a script years ago because people kept changing names and I couldn't be bothered to look for them in every server I joined just in case. Whenever I joined a server, or the people joined a server I was in, it'd check if their name matched the default one I gave them. If not, it'd warn me in chat that they joined giving the name and ID. Are you trying to do something like that?