This script creates a function, isGM(id) , which is accessible by other scripts to identify players vs. GMs. GM info is automatically collected by comparing the msg.who from non-api messages to the player._displayname. Since non-api chat messages append ' (GM)' to GMs in msg.who , comparing the two will only be equal if a player is NOT a gm. ( This works regardless of if the player adds '(GM)' to their name. ) Once each player has said something in chat, they well all be identified as GM or not. isGM(id) only checks who is in the list of GMs, so even unidentified players who issue api commands that depend on the function will be denied. ( GMs should be sure to say something once after installing the script or calling !reset-isgm . ) Messages are only considered while there are unknown players. Data is cached in the state object (in a sub object named IsGM). Players that are added after the state is setup will be added to the list of unknown players on restart of the javascript sandbox. If players are promoted to GM status after being identified as players, the state can be reset with the !reset-isgm command. In the case where no GM is identified, the state can be rest with a password. ( Instructions are provided in the reply message from the !reset-isgm command. Even if players were able to reset the state, they would still not be allowed GM access. ) Usage Example : if( isGM( msg.playerid ) ) { sendChat('','/w '+msg.who+' you are a GM!'); } else { sendChat('','/w '+msg.who+' you are NOT GM!'); } GIST: <a href="https://gist.github.com/shdwjk/8d5bb062abab1846362" rel="nofollow">https://gist.github.com/shdwjk/8d5bb062abab1846362</a>...