Discord Bot Maker

Discord Bot Maker

View Stats:
Phena Holo Aug 26, 2022 @ 10:42pm
Requesting Tutorial for Percentage Chances
I wanna make a bot that has this gacha game system I have in mind.. but I don't know how to do it.

Is there a tutorial on how to make a percentage chance in Discord Bot Maker?

For example, if I trigger something, I have 70% chance of getting 1 item or variable, 20% chance of getting getting 2 items, and 10% of getting a random GIF.

I've tried to search this online, but I couldn't find it anywhere. There's only ONE search result that was helpful/not helpful was that I can use a random number generator and a "switch script". Only idk what a switch script is...
< >
Showing 1-1 of 1 comments
Maffle Sep 16, 2022 @ 4:48am 
I did it in kinda hard way, but im not programist. I just maked random generate number 1-100 and maked 100 cases. It's raw data for this Actions
{
"name": "Sample",
"permissions": "NONE",
"restriction": "1",
"_id": "sqUrA",
"actions": [
{
"storage": "1",
"varName": "rand-num",
"min": "1",
"max": "100",
"name": "Generate Random Number"
},
{
"title": "Title if u want it",
"author": "",
"color": "",
"timestamp": "false",
"url": "",
"authorIcon": "",
"imageUrl": "",
"thumbUrl": "https://a.allegroimg.com/original/01f29a/36dc7ea642be93c6813ac523213a",
"storage": "1",
"varName": "DiceEmbedMsg",
"name": "Create Embed Message"
},
{
"storage": "1",
"varName": "DiceEmbedMsg",
"message": ":game_die: ***U can put text here too ${tempVars(\"rand-num\")}!***",
"name": "Set Embed Description"
},
{
"storage": "1",
"varName": "DiceEmbedMsg",
"channel": "0",
"varName2": "",
"storage3": "0",
"varName3": "",
"name": "Send Embed Message"
},
{
"behavior": "0",
"interpretation": "0",
"code": "switch(tempVars(\"rand-num\")){\ncase 1: msg.channel.send(\" \"); break;\ncase 2:",
"storage": "0",
"varName": "",
"name": "Run Script"
}
],
"_aliases": []
}
< >
Showing 1-1 of 1 comments
Per page: 1530 50