1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Guaranteed drop with chance

Discussion in 'Skript' started by CringeBoy, Jun 9, 2021.

Thread Status:
Not open for further replies.
  1. CringeBoy

    CringeBoy Active Member

    Joined:
    May 20, 2021
    Messages:
    65
    Likes Received:
    0
    Code (Text):
    1. on right click:
    2.   if event-block is ender portal frame:
    3.     open virtual chest inventory with size 1 named "Crate" to player
    4.     chance of 14%:
    5.       add 2 gray dye to {_ccrate::*}
    6.     chance of 14%:
    7.       add 1 cactus green to {_ccrate::*}
    8.     chance of 14%:
    9.       add 3 rose red to {_ccrate::*}
    10.     chance of 14%:
    11.       add 3 magenta dye to {_ccrate::*}
    12.     chance of 14%:
    13.       add 1 orange dye to {_ccrate::*}
    14.     chance of 14%:
    15.       add 1 cocoa bean to {_ccrate::*}
    16.     chance of 4%:
    17.       add golden chestplate named "&fHazmat Suit" to {_ccrate::*}
    18.     chance of 1%:
    19.       add 1 chainmail helmet to {_ccrate::*}
    20.     chance of 1%:
    21.       add 1 chainmail helmet of knockback 7 with all flags hidden to {_ccrate::*}
    22.     chance of 1%:
    23.       add 1 ladder item named "&fWooden Ladder" to {_ccrate::*}
    24.     chance of 1%:
    25.       add chainmail chestplate to {_ccrate::*}
    26.     chance of 1%:
    27.       add chainmail leggings to {_ccrate::*}
    28.     chance of 1%:
    29.       add iron axe to {_ccrate::*}
    30.     chance of 1%:
    31.       add wood button named "&fSatchel Charge" to {_ccrate::*}
    32.     loop {_ccrate::*}:
    33.       set slot 1 of player's current inventory to loop-value
    34.     chance of 100%:
    35.       add 5 feather to {_ccratescrap::*}
    36.     loop {_ccratescrap::*}:
    37.       set slot 0 of player's current inventory to loop-value
    38. on inventory close:
    39.   wait 1 tick
    40.   if event-block is ender portal frame:
    41.     set event-block to air
    Can someone tell me how I can make it to give 1 of the items guaranteed but also have chances? Cuz if I leave it like that there is a chance of leaving the slot empty
     
  2. mj80

    mj80 Member

    Joined:
    Jul 5, 2020
    Messages:
    1
    Likes Received:
    1
    This is how I usually do chances (all of these have a 25% chance of occuring)
    Code (Text):
    1. chance of 25%:
    2.     send "1"
    3.     stop
    4. chance of 33%:
    5.     send "2"
    6.     stop
    7. chance of 50%:
    8.     send "3"
    9.     stop
    10. chance of 100%:
    11.    send "4"
    12.     stop
     
    • Like Like x 1
  3. CringeBoy

    CringeBoy Active Member

    Joined:
    May 20, 2021
    Messages:
    65
    Likes Received:
    0
    I asked for a way to make it so u get 1 of the items with chance guaranteed so there won't be a chance of getting nothing, not something that I've already got
     
  4. Jayden13O

    Jayden13O Member

    Joined:
    Jun 9, 2021
    Messages:
    22
    Likes Received:
    1
    The code given always gives 1 of the items and never 0, didn't you want a code to do that or am i wrong?
     
    • Like Like x 1
Thread Status:
Not open for further replies.

Share This Page

Loading...