Advertisement
Sergiovan

Untitled

Apr 20th, 2015
471
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function nounReplace(x, y){
  2.     if(y === "{noun}"){
  3.         return "{noun}"; //Return a random singular noun instead
  4.      }else{
  5.         return "{nouns}"; //Return a random plural noun instead
  6.     }
  7. }
  8.  
  9. message.replace(/(\{nouns?\})/gi, nounReplace);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement