Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. /**
  2. *
  3. * @author Andy
  4. */
  5.  
  6. var status;
  7. var text;
  8. var spawns = [
  9. /* edit them yourself - you can add more as well!
  10. [name, mobId, itemId, amount(item)]*/
  11. ["snail", 100100, 4000000, 10], // this is an example, name is "snail" - spawns 100100 (snail) - for item 10 4000000 (blue snail shell)
  12. /*["input2", 1, 1, 1],
  13. ["input3", 1, 1, 1],
  14. ["input4", 1, 1, 1],
  15. ["input5", 1, 1, 1],
  16. ["input6", 1, 1, 1],
  17. ["input7", 1, 1, 1],
  18. ["input8", 1, 1, 1],
  19. ["input9", 1, 1, 1],
  20. ["input10", 1, 1, 1]*/
  21. ];
  22.  
  23. // ONLY CHANGE GREY TEXT BELOW THIS POINT!
  24. function start() {
  25. status = -1;
  26. action(1, 0, 0);
  27. }
  28.  
  29. function action(mode, type, selection) {
  30. if (mode === 1) {
  31. status++;
  32. }else{
  33. status--;
  34. }
  35. if (status === 0) {
  36. text = "Hey which monster do you want to spawn?";
  37. for (var i = 0; i < spawns.length; i++) {
  38. text += "\r\n#L" + i + "#Spawn 1 " + spawns[i][0] + " for " + spawns[selection][3] + " #i" + spawns[i][2] + "##l";
  39. }
  40. cm.sendSimple(text);
  41. } else if (status === 1) {
  42. if (cm.haveItem(spawns[selection][2], spawns[selection][3])) {
  43. cm.summonMob(spawns[selection][1], 1);
  44. cm.gainItem(spawns[selection][2], -spawns[selection][3]);
  45. } else {
  46. cm.sendOk("You need at least " + spawns[selection][3] + " #i" + spawns[i][2] + "# to spawn a " + spawns[i][0] + "");
  47. }
  48. cm.dispose();
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement