#give a random item, DeluxeMenu
1 messages · Page 1 of 1 (latest)
using <chance=#>, each item will have it's own chance, unrelated to the other itemms
In the past I had the idea of storing a random number to a meta value upon opening the menu, then when they click the item, you can use click requirements to run different success commands depending on the number
open_commands:
- '[meta] set randomnum INTEGER %rng_1,10%'
items:
rollthedie:
material: STONE
slot: 22
display_name: "&aTake your chances!"
click_requirement:
minimum_requirements: 1
stop_at_success: true #Will stop once the first requirement is met
requirements:
random1:
type: '=='
input: '%deluxemenus_meta_randomnum_INTEGER_0%'
output: '1'
optional: true
success_commands:
- '[message] You got random option 1!<delay=1>' #Delay not required, only so messages show nicely in chat
random2:
type: '=='
input: '%deluxemenus_meta_randomnum_INTEGER_0%'
output: '2'
optional: true
success_commands:
- '[message] You got random option 2!<delay=1>'
click_commands:
- '[message] Rolling the die...'
something like this
if you do NEED a requirement such as money, you can add that above the random1 and don't add optional: true
you may also need to adjust minimum_requirements to then be 2
very cool idea cj
Thx !