How do I add indefinite scaling?

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Duomax

New Member
May 21, 2023
6
1
3
25
So basically, I want to make a variable {extra} a number between 0 and the amount of levels a player/100 has, like this:
Level 0-100- between 0 and 1
100-200- between 0 and 2
200-300- between 0 and 3
and so on, with a 5% chance of even activating, or a 5% chance for it to be not 0, and equal chance to be the rest, every time a player mines a block.
I have no idea how to make this without making the skript for every single scale, is it possible? if so, how do I do this?
 
So just to be clear, you just want an easy way to calculate {extra}? if so, this is what I'm thinking:
code_language.skript:
function getExtra(lvl:integer) :: integer:
    set {_level} to round(({_lvl} / 100) + 0.5)
    set {extra} to random integer between 0 and {_level}
    return {extra}