If variabel is greather or over

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

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Kondii

Member
Jun 29, 2017
17
1
3
25
Skript Version: Skript 2.2 (dev20c)
Skript Author: Bensku
Minecraft Version: 1.8



code_language.skript:
Skript
if arg-1 is "mission":
            if arg-2 is "Diamond":
                if player have permission "mission.diamant.1":
                    if %{mine.diamond.add}% is greater than 99:
                        send "{@prefix} &a&lHURRA &aDu har klaret din første mission"
                        make console execute command "/give %player% 1 diamond block"
                        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_language.skript:
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
 
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
 
@Wynnevir
Yes you got it right.
So the the i just need to type in:
code_language.skript:
If %{mine.diamond.add}% is equal to 100:

I think i do.
I think it update everytime
code_language.skript:
On Break of Diamond Ore:
    add 1 to {mine.diamond.add}
 
@Wynnevir
Yes you got it right.
So the the i just need to type in:
code_language.skript:
If %{mine.diamond.add}% is equal to 100:

I think i do.
I think it update everytime
code_language.skript:
On Break of Diamond Ore:
    add 1 to {mine.diamond.add}
ye^-^ when the condition is met for diamond mining it'll execute whatever code you specify.
 
@Wynnevir

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

code_language.skript:
        if arg-1 is "Diamond":
            if player have permission "mission.diamant.1":
                if %{mission.diamond.add}% is equal to 100:
 
post the full code you have. it should be automatic
if arg-1 is "Diamond":

Most probably he's trying to make it work using a command.

To make it automatic:

code_language.skript:
on break of diamond ore:
    add 1 to {diamonds::%player%}
    {diamonds::%player%} is 100
    #start the mission or whatever

To make it available via a command after 100 diamonds mined:

code_language.skript:
command /mission [<text>]:
    trigger:
        arg 1 is "diamond":
            {diamonds::%player%} is less than 100:
                message "lol nope you lack diamonds"
                stop
            #start the mission or whatever
 
Skript Version: Skript 2.2 (dev20c)
Skript Author: Bensku
Minecraft Version: 1.8



code_language.skript:
Skript
if arg-1 is "mission":
            if arg-2 is "Diamond":
                if player have permission "mission.diamant.1":
                    if %{mine.diamond.add}% is greater than 99:
                        send "{@prefix} &a&lHURRA &aDu har klaret din første mission"
                        make console execute command "/give %player% 1 diamond block"
                        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_language.skript:
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
you set the {mine.diamond.add} variable to a number?
 
Status
Not open for further replies.