Advertisement
BruhBaby

Quests with Madcommands (with GUI)

Jul 3rd, 2022
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.82 KB | None | 0 0
  1. Anything in "<>" is what YOU edit. Also, you can add as many buttons as you'd like for Quest Items (look starting at line 5) as long as you follow the format for the Button Text, and classify them as buttons (like Line 8-10), AND make sure they have a response output (like like 13-15).
  2.  
  3. Quest GUI Code for Madcommands:
  4.  
  5. cmd create <command name> <description>
  6. cmd insert <command name> 1 %player% = %p%
  7. cmd insert <command name> 2 %gui%[\"type\"] = \"form\"
  8. cmd insert <command name> 3 %gui%[\"title\"] = \"<title>\"
  9. cmd insert <command name> 4 %gui%[\"content\"] = \"<content>\"
  10. cmd insert <command name> 5 %button0%[\"text\"] = \"<Required Quest Item 1>\"
  11. cmd insert <command name> 6 %button1%[\"text\"] = \"<Required Quest Item 2>\"
  12. cmd insert <command name> 7 %button2%[\"text\"] = \"<Required Quest Item 3>\"
  13. cmd insert <command name> 8 %buttons%[] = %button0%
  14. cmd insert <command name> 9 %buttons%[] = %button1%
  15. cmd insert <command name> 10 %buttons%[] = %button2%
  16. cmd insert <command name> 11 %gui%[\"buttons\"] = %buttons%
  17. cmd insert <command name> 12 %response% = dialog(%player%,%gui%)
  18. cmd insert <command name> 13 if %response% = 0 then goto 50
  19. cmd insert <command name> 14 if %response% = 1 then goto 60
  20. cmd insert <command name> 15 if %response% = 2 then goto 76
  21. cmd insert <command name> 16 exit
  22.  
  23. Here is where you customize rewards and make sure the command reads the Item in their hand properly.
  24. Let's say, for example, that "Required Quest Item 1" is 6 blocks of Stone, Item 2 is 50 Blocks of Andesite, and Item 3 is 19 Compasses.
  25. Then, let's say that the rewars for the Stone is $500, the Andesite is $400 and 6 Steak, and the Compasses are $1500 and they get 2 Diamonds named Steve. (You can set up the rewards to be anything you want, a rank change, give them money, give them items, ban them, kick them, change their gamemode, etc etc etc, whatever you want it to be. The stuff above is just for example purposes).
  26.  
  27. cmd insert <command name> 50 let %hand% = playerhand(%p%)
  28. cmd insert <command name> 51 if %hand%[\"id\"] = \"1\" then goto 54
  29. cmd insert <command name> 52 message %p% <whatever you want it to say to tell the player they aren't holding the right item>
  30. cmd insert <command name> 53 exit
  31. cmd insert <command name> 54 if %hand%[\"count\"] >= \"6\" then goto 57
  32. cmd insert <command name> 55 message %p% <whatever you want it to say to tell the player they don't have enough of the right item>
  33. cmd insert <command name> 56 exit
  34. cmd insert <command name> 57 ascon /rmitem %p% 1 6
  35. cmd insert <command name> 58 ascon /givemoney %p% 500
  36. cmd insert <command name> 59 exit
  37. cmd insert <command name> 60 let %hand% = playerhand(%p%)
  38. cmd insert <command name> 61 if %hand%[\"id\"] = \"1\" then goto 64
  39. cmd insert <command name> 62 message %p% <whatever you want it to say to tell the player they aren't holding the right item>
  40. cmd insert <command name> 63 exit
  41. cmd insert <command name> 64 if %hand%[\"variant\"] = \"5\" then goto 67
  42. cmd insert <command name> 65 message %p% <whatever you want it to say to tell the player they aren't holding the right item>
  43. cmd insert <command name> 66 exit
  44. cmd insert <command name> 67 if %hand%[\"count\"] >= \"50\" then goto 70
  45. cmd insert <command name< 68 message %p% <whatever you want it to say to tell the player they don't have enough of the right item>
  46. cmd insert <command name> 69 exit
  47. cmd insert <command name> 70 ascon /rmitem %p% 1:5 50
  48. cmd insert <command name> 71 ascon /givemoney %P% 400
  49. cmd insert <command name> 72 sleep 1
  50. cmd insert <command name> 73 #always have a sleep added whenever you are giving a player something after removing something else from their inventory, otherwise, it doesn't give them the item (this line doesn't affect the code)
  51. cmd insert <command name> 74 ascon /give %p% steak 6
  52. cmd insert <command name> 75 exit
  53. cmd insert <command name> 76 let %hand% = playerhand(%p%)
  54. cmd insert <command name> 77 if %hand%[\"id\"] = \"345\" then goto 80
  55. cmd insert <command name> 78 message %p% <whatever you want it to say to tell the player they aren't holding the right item>
  56. cmd insert <command name> 79 exit
  57. cmd insert <command name> 80 if %hand%[\"count\"] >= \"19\" then goto 83
  58. cmd insert <command name> 81 message %p% <whatever you want it to say to tell the player they don't have enough of the right item>
  59. cmd insert <command name> 82 exit
  60. cmd insert <command name> 83 ascon /rmitem %p% 345 19
  61. cmd insert <command name> 84 ascon /givemoney %p% 1500
  62. cmd insert <command name> 85 sleep 1
  63. cmd insert <command name> 86 ascon /give %p% 261 2 {display:{Name:\"Steve\"}}
  64. cmd insert <command name> 87 exit
  65.  
  66. That's it for a basic/general quest command. You can, however, exclude certain groups/ranks from seeing certain quests (for example, a prisons server with A mine specific quests, and then b mine specific quests, and so on, but you'll have to DM me for that kind of thing).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement