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!

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

Drop table with chances

Discussion in 'Requests' started by Bit, Jul 28, 2022.

  1. Bit

    Bit Member

    Jan 26, 2021
    Likes Received:
    Hey y'all,

    I'm currently working on a custom skript where I need my own loot table. There are items with a high percentage to drop and some with a low percentage, I could do chance of x: but as those loot tables would have around 70+ items, I've been looking around for a way to do this without 500 lines of chance and if else.

    Yet I, for the love of Skript, couldn't find any clever way to do this, does anyone of you have an idea on how to approach this?

    All the data regarding versioning etc.:
    Code (Text):
    1. Server Version: git-Paper-387 (MC: 1.18.2)
    2. Skript Version: 2.6.3
    3. Installed Skript Addons:
    4.  - skript-yaml v1.4
    5.  - skript-reflect v2.3 (https://github.com/TPGamesNL/skript-reflect)
    6.  - skRayFall v1.9.28 (https://sk.rayfall.net/)
    7.  - SkQuery v4.1.7
    8.  - SkBee v1.17.3 (https://github.com/ShaneBeee/SkBee)
    9.  - Skript-Packet v2.1.0 (www.github.com/Anarchick/skript-packet)
    10. Installed dependencies:
    11.  - WorldGuard v7.0.7+216b061
    Thanks a lot for the help!
  2. MiiTsY

    MiiTsY Member

    May 27, 2022
    Likes Received:
    hmmm maybe use list variables, one for the dropchance and the other one the items and then loop it ?
    Code (Text):
    1. on death:
    2.     victim is zombie:
    3.         set {_i} to 0
    4.         loop 70 times:
    5.             chance of {_list1::{_i}}%:
    6.                 give player {_list2::{_i}}
    7.             add 1 to {_i}
    something like that i guess
  3. Bit

    Bit Member

    Jan 26, 2021
    Likes Received:
    Update to this, I'm still looking for a solution. The loot table has the following datapoints:
    Item, Price, Location (region where it should drop), Time min, Time max (these are the times between which it should be dropped), Weather (which weather is needed for it to drop).

    Does anyone have ideas on how to do this?

Share This Page