If you were to arrange an RNG type item system with multiple values and chances like so (This is just a rough example by the way):
Would there by a way to make this kind of code more effective (Ideally to be a lot shorter and with the ability to have a lot more % chances without using up a lot of lines)?
Code:
function exam(n: text, p: player)
chance of 5%:
give {_p} 1 of gold ingot named "%{_n}%"
stop
chance of 1%:
give {_p} 1 of diamond named "%{_n}%"
stop
command test:
trigger:
chance of 1.5%:
set {_p} to player
set {_name} to "&bExample"
examp({_name}, {_p})
Would there by a way to make this kind of code more effective (Ideally to be a lot shorter and with the ability to have a lot more % chances without using up a lot of lines)?
Last edited: