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.

Boss battle loot

Discussion in 'Skript' started by Grandfish, Mar 30, 2021.

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

    Grandfish Member

    Joined:
    Feb 8, 2021
    Messages:
    13
    Likes Received:
    0
    Im making a boss system where when u kill the boss, it has some drops, here is my current code:
    Code (Text):
    1. on damage:
    2.     if victim is pufferfish named "Spike":
    3.         if the final damage is bigger than the health of victim:
    4.         loop all entities in radius 15 around victim:
    5.             chance of 12%:
    6.                 give loop-entities prismarine shard named "&aSea Shard" with lore "&aRARE"
    7.             chance of 1%:
    8.                 give loop-entities diamond sword named "&6Prismablade" with lore "&6LEGENDARY"
    9.             chance of 50%:
    10.                 give loop-entities sponge named "&aSpike's Dolly" with lore "&aRARE"
    11.             chance of 5%:
    12.                 give loop-entities music disc named "&6Spike's Music" with lore "&6LEGENDARY"
    13.             chance of 32%:
    14.                 give loop-entities potion named "&aSpike's Baby Bottle" with lore "&aRARE"
    The problem is, it will give the entire team the same loot, and I wan't each player to get a different item, but they each have the same probability.

    So when u kill a pufferfish named spike, every entity in a 15 block radius has a chance at each of the items in the code box.
     
  2. Shadow501pl

    Shadow501pl Active Member

    Joined:
    Dec 19, 2020
    Messages:
    62
    Likes Received:
    2
    Generate a random integer and then if it's ex 1 give that loop-player that drop
     
  3. Grandfish

    Grandfish Member

    Joined:
    Feb 8, 2021
    Messages:
    13
    Likes Received:
    0
    can u give me an example?
     
  4. Shadow501pl

    Shadow501pl Active Member

    Joined:
    Dec 19, 2020
    Messages:
    62
    Likes Received:
    2
    here
    Code (Text):
    1. thingy:
    2.   set {_x} to random integer between 1 and 5 #change this to the amount like 1 and 6 if you want to make something more common
    3.   if {_x} is 1:
    4.     give player 1 blaze powder named "&5Dragon's breath" with lore "&5&lEPIC"
    5.   if {_x} is 2:
    6.     #etc
     
Thread Status:
Not open for further replies.

Share This Page

Loading...