Hi guys,
I ran into a little problem with my code.
What i want is that there is a chance that you get food, and if the chance decides to give you food, that there is 90% chance that it is a basic food, 40% that it is a normal food and 10% chance that it is a epic food.
How do i write this?
I ran into a little problem with my code.
code_language.skript:
else if arg-1 is "begin":
chance of 90%:
clear targeted block's inventory
set {_begin} to random element out of {basic.food::*}
add {_begin} to targeted block's inventory
chance of 90%:
set {_begin} to random element out of {basic.food::*} # chance of getting a second basic food item
add {_begin} to targeted block's inventory
chance of 40%:
set {_begin} to random element out of {normal.food::*} #Chance of getting a third basic food item
add {_begin} to targeted block's inventory
chance of 40%:
set {_begin} to random element out of {normal.food::*} # Chance of getting a second normal food item
add {_begin} to targeted block's inventory
chance of 10%:
set {_begin} to random element out of {epic.food::*}
add {_begin} to targeted block's inventory
What i want is that there is a chance that you get food, and if the chance decides to give you food, that there is 90% chance that it is a basic food, 40% that it is a normal food and 10% chance that it is a epic food.
How do i write this?