#chance function

1 messages · Page 1 of 1 (latest)

glossy nacelle
#

I have a question about the "chance" function, whether it is possible, for example, to give that only 1 command executes out of 5 commands.

#

below is an example of what I mean exactly

left_click_commands:
    - '[console] mmoitems give CONSUMABLE WHITE_POT_1 %player_name% 1 <chance=20>'
    - '[console] mmoitems give CONSUMABLE WHITE_POT_2 %player_name% 1 <chance=20>'
    - '[console] mmoitems give CONSUMABLE WHITE_POT_3 %player_name% 1 <chance=20>'
    - '[console] mmoitems give CONSUMABLE WHITE_POT_4 %player_name% 1 <chance=20>'
    - '[console] mmoitems give CONSUMABLE WHITE_POT_5 %player_name% 1 <chance=20>'
    - '[console] mmoitems take MATERIAL EMPTY_BOTTLE %player_name% 1'
    - '[console] mmoitems take MATERIAL KAMELIA %player_name% 1'
grave elbow
#

Not possible, but I had ideas in the past using rng + meta

iron spruce
#

Is there no expansion that can give you a random element from a list ? @grave elbow

#

Or actually, you just need a random number between 1 and 5
mmoitems give CONSUMABLE WHITE_POT_%random_number_placeholder% %player_name% 1

grave elbow
grave elbow
iron spruce
#

Ive seen worse

#

@glossy nacelle there's %string_random_<string1>,<string2>,<string3>,<etc>% in the string expansion as cj said, or you can implement my example using %rng_1,5% from the rng expansion

mmoitems give CONSUMABLE WHITE_POT_%rng_1,5% %player_name% 1

eager cipher
#

o I found what I m looking for but I don t know how to do it could you please do it using my example of drawing a key because I don t know exactly how it works I'd be very grateful

#

left_click_commands:
- '[refresh]'
- '[message]'
- '[message]&a&l Wylosowałeś jakąś nagrode!'
- '[message]'
- '[console] getcase give %player_name% Epicka 1 <chance=10>'
- '[console] getcase give %player_name% Legendarna 1 <chance=3>'
- '[console] getcase give %player_name% Rzadka 1 <chance=30>'
- '[console] getcase give %player_name% Zwykla 1 <chance=50>

eager cipher
grave elbow
#

you have to use the string placeholder.
What are you needing help with?

iron spruce
#

getcase give %player_name% %string_random_Epicka 1,Legendarna 1,Rzadka 1,Zwykla 1% but this doesn't allow you to set a chance for each of the cases =/

grave elbow
eager cipher
grave elbow
#

to start it off, maybe elaborate on what part(s) you don't understand, even if it's the whole thing

then I can help more from there

eager cipher
#

I mainly care about deducting a given mailbo if I manage to send a message, it will be fine

#

the main problem is that there is no message after pressing the stone