Tutorials_for_BDFD

Giveaway

Mar 16th, 2025 (edited)
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.14 KB | None | 0 0
  1. Trigger: !giveaway
  2.  
  3.  
  4. $nomention
  5. $onlyIf[$guildID!=;this code only works in a server]
  6. $onlyIf[$scriptLanguage==BDScript 2;❌ Dieser Code funktioniert nur mit BDScript 2!]
  7.  
  8. $argsCheck[>0;❌ Bitte gib einen Preis an! Beispiel: !giveaway Nitro Basic]
  9.  
  10. $c[Variablen prüfen]
  11. $varExistError[giveawayParticipants;❌ Bitte erstelle die Variable giveawayParticipants]
  12. $varExistError[giveawayPrice;❌ Bitte erstelle die Variable giveawayPrice]
  13.  
  14. $c[Dummy-Wert festlegen, damit es nie leer ist]
  15. $setVar[giveawayParticipants;]
  16.  
  17. $c[Speichere den Preis]
  18. $setVar[giveawayPrice;$message]
  19.  
  20. $c[Teilnehmerliste splitten mit ; Separator]
  21. $textSplit[$getVar[giveawayParticipants];\;]
  22.  
  23. $c[Zähle Teilnehmer abzüglich Dummy-Eintrag]
  24. $var[participantCount;$sub[$getTextSplitLength;1]]
  25.  
  26. $title[🎉 Giveaway gestartet!]
  27. $description[
  28. 🎁 **Preis:** $getVar[giveawayPrice]
  29.  
  30. 👤 $var[participantCount] Teilnehmer
  31.  
  32. Klicke auf den Button, um teilzunehmen!
  33. Der Gewinner wird später per Knopfdruck ausgelost.]
  34. $footer[Veranstaltet von $username]
  35. $color[#3498db]
  36.  
  37. $addButton[yes;join_giveaway;🎟️ Teilnehmen;primary]
  38. $addButton[yes;pick_winner;🎉 Gewinner ziehen;success]
  39.  
  40. $thumbnail[https://cdn.discordapp.com/attachments/1014172909448732774/1350428514746241054/NA_TadaIcon.png?ex=67d6b40f&is=67d5628f&hm=9375a70ca4e858d512092d0cd77024c17677c2f82dc3c10809055e1c72c14155&]
  41.  
  42.  
  43.  
  44.  
  45. _____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
  46.  
  47. Trigger: $onInteraction
  48.  
  49.  
  50.  
  51. $nomention
  52. $onlyIf[$guildID!=;this code only works in a server]
  53. $onlyIf[$scriptLanguage==BDScript 2;❌ Dieser Code funktioniert nur mit BDScript 2!]
  54.  
  55. $c[Variablen prüfen]
  56. $varExistError[giveawayParticipants;❌ Bitte erstelle die Variable giveawayParticipants]
  57. $varExistError[giveawayPrice;❌ Bitte erstelle die Variable giveawayPrice]
  58.  
  59. $c[Interaktionskontrolle]
  60. $if[$customID==join_giveaway]
  61.  
  62. $removeButtons
  63. $ephemeral
  64.  
  65. $c[Prüfe, ob User bereits teilgenommen hat]
  66. $if[$checkContains[$getServerVar[giveawayParticipants];$authorID]==false]
  67.  
  68. $c[Füge User zur Teilnehmerliste hinzu]
  69. $setServerVar[giveawayParticipants;$getServerVar[giveawayParticipants]$authorID\;]
  70.  
  71. $c[Splitte die neue Teilnehmerliste und zähle]
  72. $textSplit[$getServerVar[giveawayParticipants];\;]
  73.  
  74. $title[🎉 Teilnahme bestätigt!]
  75. $description[
  76. ✅ **$username** hat erfolgreich teilgenommen!
  77. 🎁 **Preis:** $getServerVar[giveawayPrice]
  78. 👤 $getTextSplitLength Teilnehmer]
  79. $footer[Veranstaltet von $username]
  80. $color[#2ecc71]
  81.  
  82. $else
  83.  
  84. $c[Entferne User aus Teilnehmerliste]
  85. $setServerVar[giveawayParticipants;$replaceText[$getServerVar[giveawayParticipants];$authorID\;;]]
  86.  
  87. $c[Splitte die neue Teilnehmerliste und zähle]
  88. $textSplit[$getServerVar[giveawayParticipants];\;]
  89.  
  90. $title[🚫 Teilnahme zurückgezogen!]
  91. $description[
  92. ❌ **$username** wurde vom Giveaway entfernt!
  93. 🎁 **Preis:** $getServerVar[giveawayPrice]
  94. 👤 $getTextSplitLength Teilnehmer]
  95. $footer[Veranstaltet von $username]
  96. $color[#e74c3c]
  97.  
  98. $endif
  99.  
  100. $else
  101.  
  102. $if[$customID==pick_winner]
  103.  
  104. $removeButtons
  105.  
  106. $varExistError[giveawayParticipants;❌ Bitte erstelle die Variable giveawayParticipants]
  107. $varExistError[giveawayPrice;❌ Bitte erstelle die Variable giveawayPrice]
  108.  
  109. $c[Splitte Teilnehmerliste]
  110. $textSplit[$getServerVar[giveawayParticipants];\;]
  111.  
  112. $c[Prüfe ob Teilnehmer vorhanden sind]
  113. $if[$getTextSplitLength>0]
  114.  
  115. $c[Ziehe zufälligen Index für Gewinner]
  116. $var[winnerIndex;$random[1;$getTextSplitLength]]
  117.  
  118. $c[Hole UserID aus splitText mit Index]
  119. $var[winner;$splitText[$var[winnerIndex]]]
  120.  
  121. $title[🎊 Giveaway Gewinner!]
  122. $description[
  123. Herzlichen Glückwunsch <@$var[winner]>!
  124. Du hast $getServerVar[giveawayPrice] gewonnen! 🎉]
  125. $footer[Veranstaltet von $username]
  126. $color[#f1c40f]
  127.  
  128. $c[Prüfe, ob der Gewinner existiert, bevor eine DM gesendet wird]
  129. $if[$var[winner]!=]
  130.  
  131. $channelSendMessage[$dmChannelID[$var[winner]];🎉 Glückwunsch! Du hast **$getServerVar[giveawayPrice]** im Giveaway gewonnen! Bitte kontaktiere das Team für weitere Infos.]
  132.  
  133. $else
  134.  
  135. $c[Kein Gewinner wurde gezogen]
  136. $title[Fehler]
  137. $description[❌ Es wurde kein Gewinner gefunden!]
  138. $footer[Veranstaltet von $username]
  139. $color[#e74c3c]
  140.  
  141. $endif
  142.  
  143. $setServerVar[giveawayParticipants;]
  144.  
  145. $else
  146.  
  147. $title[🎉 Giveaway gestartet!]
  148. $description[
  149. ❌ **Es gibt keine Teilnehmer!**
  150. 🎁 **Preis:** $getServerVar[giveawayPrice]]
  151. $footer[Veranstaltet von $username]
  152. $color[#3498db]
  153.  
  154. $endif
  155.  
  156. $endif
  157. $endif
Advertisement
Add Comment
Please, Sign In to add comment