Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Variable
- gw = 0¤0¤0¤0¤?
- gw2 =
- Code 1
- Trigger : !gwstart
- Script : BDSCRIPT 2
- $nomention
- $suppressErrors
- $onlyIf[$getUserVar[gw]==0¤0¤0¤0¤?;you're already hosting a giveaway]
- $var[t;$message[1]]
- $var[w;$replaceText[$message[2];w;]]
- $var[p;$replaceText[$replaceText[$message;$var[t];];$var[w];]]
- $if[$var[t]==]
- $description[Provide a giveaway duration]
- $color[#ff0000]
- $elseif[$isNumber[$replaceText[$replaceText[$replaceText[$var[t];s;];m;];h;]]==false]
- $description[Giveaway duration is invalid, provide a number]
- $elseif[$or[$checkContains[$var[t];s;m]==false;$checkContains[$var[t];h]==true]==true]
- $description[Provide a valid timer sign
- available: s (seconds), m (minutes)]
- $elseif[$and[$checkContains[$var[t];s]==true;$replaceText[$var[t];s;]>2400]==true]
- $description[Giveaway cannot be longer than 40 minutes]
- $color[#ff0000]
- $elseif[$replaceText[$var[t];s;]==1]
- $description[Giveaway duration must be more than 1 second]
- $color[#ff0000]
- $elseif[$and[$checkContains[$var[t];m]==true;$replaceText[$var[t];m;]>40]==true]
- $description[Giveaway cannot be longer than 40 minutes]
- $color[#ff0000]
- $elseif[$var[w]==]
- $description[Provide the amount of winners]
- $elseif[$isNumber[$var[w]]==false]
- $description[Provide a valid amount of winners]
- $color[#ff0000]
- $elseif[$var[w]>15]
- $description[Max winners are 15]
- $color[#ff0000]
- $elseif[$var[p]==]
- $description[provide a prize]
- $color[#ff0000]
- $elseif[$charCount[$var[p]]>256]
- $description[Max prize characters is 256]
- $color[#ff0000]
- $else
- $var[id;$sendEmbedMessage[$channelID;;$replaceText[$var[p];|;¤];;**Giveaway Duration:** $replaceText[$replaceText[$var[t];s; seconds];m; minutes]
- **Amount of Winners:** $var[w]
- **Total Entries:** 0
- **Hosted By:** <@$authorID>;$random[1;16777216];;;Click 🎉 Join Giveaway to join the giveaway;;;;;yes]]
- $setUserVar[gw;$var[id]¤$authorID¤$var[t]¤$var[w]¤$var[p]]
- $addButton[no;gjoin-$authorID;Join Giveaway;$randomText[primary;success];;🎉;$var[id]]
- $addButton[no;gleave-$authorID;Leave;danger;;;$var[id]]
- $var[t;there were not enough participants to determine a winner on this giveaway]
- $endif
- $async[1]
- $textSplit[$getUserVar[gw];¤]
- $var[uwu;$splitText[1]]
- $var[wt1;$splitText[4]]
- $replyIn[$splitText[3]]
- $textSplit[$getUserVar[gw2]; ]
- $var[wt2;$getTextSplitLength]
- $if[$var[wt2]<=1]
- $sendEmbedMessage[$channelID;;Jump to giveaway;https://discord.com/channels/$guildID/$channelID/$var[uwu];**$var[t]**;$random[1;16777216]]
- $textSplit[$getUserVar[gw];¤]
- $editMessage[$channelID;$splitText[1];;Giveaway Finished;**Winner$replaceText[$replaceText[$checkCondition[$splitText[4]==1];true;];false;s]:** nobody;$random[1;16777216];]
- $removeButtons[$splitText[1]]
- $setUserVar[gw;0¤0¤0¤0¤?]
- $setUserVar[gw2;]
- $else
- $if[$var[wt1]>$var[wt2]]
- $var[u;$var[wt2]]
- $else
- $var[u;$var[wt1]]
- $endif
- $var[a;$cropText[$repeatMessage[3;$repeatMessage[5;a]];$var[u];]]
- $textSplit[$getUserVar[gw2]; ]
- $var[win;$trimSpace[$eval[$replaceText[$var[a];a;<@%{DOL}%optOff[%{DOL}%splitText[%{DOL}%random[1\;%{DOL}%sum[%{DOL}%var[u\]\;1\]\]\]\]>, ;-1]]]]
- $var[win;$cropText[$var[win];$sub[$charCount[$var[win]];1];]]
- $textSplit[$getUserVar[gw];¤]
- $editMessage[$channelID;$splitText[1];;Giveaway Finished;**Winner$replaceText[$replaceText[$checkCondition[$splitText[4]==1];true;];false;s]:** $var[win];$random[1;16777216];Congratulations to the winner$replaceText[$replaceText[$checkCondition[$splitText[4]==1];true;];false;s]!]
- $sendEmbedMessage[$channelID;$var[win];Jump to giveaway;https://discord.com/channels/$guildID/$channelID/$var[uwu];Congratulations **$var[win]** for winning the giveaway for**$splitText[5]**;$random[1;16777216]]
- $editButton[gjoin-$authorID;Join Giveaway;secondary;yes;🎉;$splitText[1]]
- $editButton[gleave-$authorID;Leave;danger;yes;;$splitText[1]]
- $endif
- $setUserVar[gw;0¤0¤0¤0¤?]
- $setUserVar[gw2;]
- $endasync
- Code 2
- Trigger : $oninteraction
- Script : BDScript 2
- $nomention
- $if[$checkContains[$customID;gjoin]]
- $suppressErrors
- $textSplit[$customID;-]
- $var[id;$splitText[2]]
- $if[$checkContains[$getUserVar[gw2;$var[id]];$authorID]]
- $ephemeral
- $title[You're already participating]
- $removeButtons
- $color[#ff0000]
- $else
- $ephemeral
- $removeButtons
- $title[You are now participating on this giveaway]
- $color[#38E873]
- $setUserVar[gw2;$trimSpace[$getUserVar[gw2;$var[id]] $authorID];$var[id]]
- $textSplit[$getUserVar[gw2;$var[id]]; ]
- $var[t;$getTextSplitLength]
- $textSplit[$getUserVar[gw;$var[id]];¤]
- $editMessage[$channelID;$splitText[1];;$replaceText[$splitText[5];|;¤];**Giveaway Duration:** $replaceText[$replaceText[$splitText[3];s; seconds];m; minutes]
- **Amount of Winners:** $splitText[4]
- **Total Entries:** $numberSeparator[$var[t]]
- **Hosted by:** <@$var[id]>;$random[1;16777216];Click 🎉 Join Giveaway to join the giveaway]
- $endif
- $endif
- $if[$checkContains[$customID;gleave]]
- $suppressErrors
- $textSplit[$customID;-]
- $var[id;$splitText[2]]
- $if[$checkContains[$getUserVar[gw2;$var[id]];$authorID]==false]
- $title[You aren't participating]
- $removeButtons
- $color[#ff0000]
- $else
- $ephemeral
- $removeButtons
- $textSplit[$getUserVar[gw2;$var[id]]; ]
- $removeSplitTextElement[$getTextSplitIndex[$authorID]]
- $title[You left the giveaway, you're no longer participating]
- $color[#38E873]
- $setUserVar[gw2;$joinSplitText[ ];$var[id]]
- $textSplit[$getUserVar[gw2;$var[id]]; ]
- $var[t;$sub[$getTextSplitLength;1]]
- $textSplit[$getUserVar[gw;$var[id]];¤]
- $editMessage[$channelID;$splitText[1];;$splitText[5];**Giveaway Duration:** $replaceText[$replaceText[$splitText[3];s; seconds];m; minutes]
- **Amount of Winners:** $splitText[4]
- **Total Entries:** $numberSeparator[$var[t]]
- **Hosted by:** <@$var[id]>;$random[1;16777216];Click 🎉 Join Giveaway to join the giveaway]
- $endif
- $endif
Advertisement
Add Comment
Please, Sign In to add comment