Drop table with chances

  • 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!

Bit

Member
Jan 26, 2021
27
0
1
24
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:
Server Version: git-Paper-387 (MC: 1.18.2)
Skript Version: 2.6.3
Installed Skript Addons:
 - skript-yaml v1.4
 - skript-reflect v2.3 (https://github.com/TPGamesNL/skript-reflect)
 - skRayFall v1.9.28 (https://sk.rayfall.net/)
 - SkQuery v4.1.7
 - SkBee v1.17.3 (https://github.com/ShaneBeee/SkBee)
 - Skript-Packet v2.1.0 (www.github.com/Anarchick/skript-packet)
Installed dependencies:
 - WorldGuard v7.0.7+216b061

Thanks a lot for the help!
 
hmmm maybe use list variables, one for the dropchance and the other one the items and then loop it ?
Code:
on death:
    victim is zombie:
        set {_i} to 0
        loop 70 times:
            chance of {_list1::{_i}}%:
                give player {_list2::{_i}}
            add 1 to {_i}
something like that i guess
 
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?