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 Faster Crops Problem

Discussion in 'Skript' started by Mattllama987, Oct 23, 2020.

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

    Mattllama987 Active Member

    Joined:
    Aug 5, 2018
    Messages:
    225
    Likes Received:
    7
    Hello, im working on making crops grow faster on my server, and im having a small problem. When i mine my crops while they are growing, they will vanish and then grow back after a few seconds. How can i prevent them from growing back after i mine the wheat? This is what i have at the moment.

    Thanks!
    ~Matt

    CODE:

    Code (Text):
    1. options:
    2.     wheat: 20
    3. on right click on farmland:
    4.     if player's held item is wheat seeds:
    5.         wait "%random number between 1 and {@wheat}% seconds" parsed as timespan
    6.         set block above event-block to stage 4 wheat plant
    7.         wait "%random number between 1 and {@wheat}% seconds" parsed as timespan
    8.         set block above event-block to stage 5 wheat plant
    9.         wait "%random number between 1 and {@wheat}% seconds" parsed as timespan
    10.         set block above event-block to stage 6 wheat plant
    11.         wait "%random number between 1 and {@wheat}% seconds" parsed as timespan
    12.         set block above event-block to stage 7 wheat plant
    13.         wait "%random number between 1 and {@wheat}% seconds" parsed as timespan
    14.         set block above event-block to stage 8 wheat plant
    15.         wait "%random number between 1 and {@wheat}% seconds" parsed as timespan
    16.         set block above event-block to fully grown wheat plant
     
  2. Best Answer:
    Post #2 by BaeFell, Oct 24, 2020
  3. BaeFell

    BaeFell I'm Poppy
    Admin

    Joined:
    Nov 27, 2016
    Messages:
    833
    Likes Received:
    226
    You would need to add a check after each wait to make sure it's still wheat. Skript will pause for each wait then continue. It doesn't know it's been broken. I have reworked the code to use a repeating function until it gets to stage 8.

    Take a look on the skUnity Parser: https://parser.skunity.com/d8227593
     
  4. Mattllama987

    Mattllama987 Active Member

    Joined:
    Aug 5, 2018
    Messages:
    225
    Likes Received:
    7
    I kinda like love you right now. Its working xD Thanks
     
Thread Status:
Not open for further replies.

Share This Page

Loading...