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.

Solved Randomizing drop between 4-16

Discussion in 'Skript' started by PanHack, Jan 11, 2020.

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

    PanHack Active Member

    Joined:
    Dec 18, 2019
    Messages:
    137
    Likes Received:
    8
    Ok so i want to RANDOMIZE drop between 4-16
    PLUGINS :
    SKQuerry
    Wildskript
    RandomSK
    Skellett
    skRayFall
    Code (Text):
    1. on mine of dirt:
    2.     if player's tool is shovel:
    3.         chance of 100%:
    4.             set %random integer from 4 to 16% to a random integer between 4 and 16
    5.             drop %random integer from 4 to 16% dirt
    6.             broadcast "&a&l%player% &c&lhas got %random integer from 4 to 16% iron"
    it works a little bit it randomizes number on chat but it doesn't drop that what was randomized

     
  2. Best Answer:
    Post #3 by Goose, Jan 11, 2020
  3. malia

    malia Well-Known Member

    Joined:
    Jul 24, 2019
    Messages:
    313
    Likes Received:
    20
    Well that ain't no variable nor an adequate variable name...
     
  4. Goose

    Goose Well-Known Member

    Joined:
    Nov 23, 2019
    Messages:
    402
    Likes Received:
    28
    Working on the skript, just encountered an issue in "drop {random} dirt", the skript wont take the variable as an integer, parsing it doesnt seem to work. Got any ideas, Malia?
    --- Double Post Merged, Jan 11, 2020, Original Post Date: Jan 11, 2020 ---
    Found a work-around, here ya go
    Code (Text):
    1. on mine of dirt:
    2.     if player's tool is shovel:
    3.         chance of 100%:
    4.             set {random} to a random integer between 4 and 16
    5.             loop {random} times:
    6.                 drop 1 dirt
    7.             broadcast "&a&l%player% &c&lhas got %{random}% iron"
     
    • Like Like x 1
  5. PanHack

    PanHack Active Member

    Joined:
    Dec 18, 2019
    Messages:
    137
    Likes Received:
    8
    EDIT: using ITEM ID (265) will fix problem
     
  6. malia

    malia Well-Known Member

    Joined:
    Jul 24, 2019
    Messages:
    313
    Likes Received:
    20
    How come it won't even parse? Have you tried to parse it as number?
     
  7. novastosha

    novastosha Well-Known Member

    Joined:
    Jan 11, 2019
    Messages:
    332
    Likes Received:
    21
    use drop 1 dirt at location of event-block
     
  8. Goose

    Goose Well-Known Member

    Joined:
    Nov 23, 2019
    Messages:
    402
    Likes Received:
    28
    Yes, I have tried parsing it both as a number and integer. So either it won't parse or I am not using it correctly.
     
Thread Status:
Not open for further replies.
Loading...