Index154

UCHLevelCode

Mar 9th, 2020
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. note = "allLevels is an array of level names";
  2. note = "priorityLevels is an array of level names that have priority over the others";
  3. note = "useNum is the amount of times the command has been used";
  4.  
  5. upnext = "Check if useNum is larger than the amount of names in the priorityLevels array. If yes, get a random name from the allLevels array. If not, get the next level from priorityLevels";
  6. if(useNum <= priorityLevels.length){
  7. out = priorityLevels[useNum - 1];
  8. } else {
  9. out = allLevels[Math.floor(Math.random() * (allLevels.length - 1))];
  10. }
  11.  
  12. upnext = "Output";
  13. out;
Add Comment
Please, Sign In to add comment