Advertisement
BlackKnight683

Giveaway System [BCFD]

Feb 8th, 2021
2,768
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -------------- Giveaway Create Command ---------------
  2. $eval
  3. prize = '$messageAfterCommand'
  4. var check2 = (check2 == null) ? 0 : check2 += 1
  5. if(typeof started === "undefined" && check2 === 0 && prize !== '') {var reply = "**A Giveaway has been started by $name!!**\n**Prize :**__" + prize + "__\n> Do `.join` to join!!"
  6. started = "true"
  7. arr = []}
  8. if(check2 > 0) {var reply = "A Giveaway is already being ran rn... end it to create a new one!\n**End it using `.ga end`"}
  9. if(prize === '') {var reply = "You need to set a prize!\n**Usage Example: `.ga create nitro classic`**"
  10. delete check2}
  11. $halt
  12. $get(reply)
  13. -------------- Giveaway Join Command ---------------
  14. $eval
  15. var mess = '$ID'
  16. var check = "true"
  17. if(typeof safety === 'undefined') {var safety = 1}
  18.  
  19. if(safety === 1) {
  20. var safety = safety + 1
  21. var check = "false"}
  22.  
  23.  
  24. if(typeof started !== 'undefined') {
  25.  
  26. if(arr.indexOf("$ID") !== -1){
  27. var reply = "**You have already joined this giveaway >:O**"
  28. var check3 = "false"
  29. } else{
  30. var reply = "**You have joined the giveaway :D**"
  31. check3 = "true"
  32. var array = '• `@' + "$namePlain" + '`'
  33. if(safety === 2 && check !== "false") {
  34. var array2 = array + '\n• `@' + "$namePlain" + '`'}
  35.  
  36. if(safety === 2 && check !== "false") {var array3 = array2
  37. var array = array2}
  38.  
  39. if(safety === 2 && check === "false") {var array3 = array}
  40. }
  41.  
  42. if(check3 === "true") {arr.push(mess);}
  43. }
  44. if(typeof started === 'undefined') {var reply = "**No Giveaway has been started by the mods...**"}
  45. $halt $get(reply)
  46. -------------- Giveaway Participants Command ---------------
  47. $eval
  48. if(typeof started === "undefined") {var reply = "No Giveaway has been started yet..."
  49. }else if(typeof array3 === "undefined") {var reply = "No-one has joined the giveaway..."
  50. }else {var reply = "**__People Currently Contesting :~__**\n> " + array3}
  51. $halt $get(reply)
  52. -------------- Giveaway End Command ---------------
  53. $eval
  54. if(typeof arr === 'undefined' && typeof started === 'undefined') {var reply2 = "No giveaway has been started to end"}
  55. else{
  56. var reply = arr[Math.floor(Math.random() * arr.length)]
  57. delete started
  58. delete arr
  59. delete check
  60. delete check2
  61. delete check3
  62. var reply2 = "**Giveaway has ended!**\n<@" + reply + "> won!! 🎉🎉";
  63. }
  64. $halt
  65. $get(reply2)
  66. ----------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement