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.

If variabel is greather or over

Discussion in 'Skript' started by Kondii, Aug 30, 2017.

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

    Kondii Member

    Joined:
    Jun 29, 2017
    Messages:
    17
    Likes Received:
    1
    Skript Version: Skript 2.2 (dev20c)
    Skript Author: Bensku
    Minecraft Version: 1.8



    Code (Skript):
    1. Skript
    2. if arg-1 is "mission":
    3.             if arg-2 is "Diamond":
    4.                 if player have permission "mission.diamant.1":
    5.                     if %{mine.diamond.add}% is greater than 99:
    6.                         send "{@prefix} &a&lHURRA &aDu har klaret din første mission"
    7.                         make console execute command "/give %player% 1 diamond block"
    8.                         make console execute command "/manuaddp %player% mission.diamant.2"
    Addons:
    PirateSk
    SkQuery
    SkRayFall
    Tusku
    Umbaska
    WildSkript

    Problem?
    My problem is that i don't know how to make that
    Code (Skript):
    1. if %{mine.diamond.add}% is greather than 99:
    I don't know how to make it so its reacts when it hits 100. Is like mission a little mission! Need more detailes just say it!

    //Kondii
     
  2. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    You just want it to execute code when {mine.diamond.add} hits 100? Do I have that right? you can just check if it's equal to 100.
    if you need it to go up by one every time a diamond is mined, do your check there on that event
     
  3. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    @Wynnevir
    Yes you got it right.
    So the the i just need to type in:
    Code (Skript):
    1. If %{mine.diamond.add}% is equal to 100:
    I think i do.
    I think it update everytime
    Code (Skript):
    1. On Break of Diamond Ore:
    2.     add 1 to {mine.diamond.add}
     
  4. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    ye^-^ when the condition is met for diamond mining it'll execute whatever code you specify.
     
  5. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    @Wynnevir

    Now it is saying "Can't compare %{mission.diamond.add}% with an interger"

    Code (Skript):
    1.  
    2.         if arg-1 is "Diamond":
    3.             if player have permission "mission.diamant.1":
    4.                 if %{mission.diamond.add}% is equal to 100:
    5.  
     
  6. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    No percents around {mission.diamond.add}
     
    • Agree Agree x 1
  7. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    Can you make it automatic some how??
    Cause it does not react to it, i tryed remove the command. Bot is does not goes off when i hit the 100. Pls help
     
  8. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    post the full code you have. it should be automatic
     
  9. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    Most probably he's trying to make it work using a command.

    To make it automatic:

    Code (Skript):
    1. on break of diamond ore:
    2.     add 1 to {diamonds::%player%}
    3.     {diamonds::%player%} is 100
    4.     #start the mission or whatever
    To make it available via a command after 100 diamonds mined:

    Code (Skript):
    1. command /mission [<text>]:
    2.     trigger:
    3.         arg 1 is "diamond":
    4.             {diamonds::%player%} is less than 100:
    5.                 message "lol nope you lack diamonds"
    6.                 stop
    7.             #start the mission or whatever
     
  10. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    you set the {mine.diamond.add} variable to a number?
     
Thread Status:
Not open for further replies.

Share This Page

Loading...