Solved Variables help

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

GiorgixPRO

Member
Jul 29, 2017
44
0
0
25
Hello, how do I make that every 100 blocks mined from the player, the console execute the command?

code_language.skript:
variables:
    {minedblocks.%player%} = 0

on first join:
    set {minedblocks.%player%} to 0


on mine:
         add 1 to {minedblocks.%player%}
       #every 100 blocks mined from the player:
        chance of 50%:
            execute console command "giveminebomb %player% 1"
            send "&aHai scavato 100 blocchi! Ti abbiamo regalato una &6Minebomb&a!"
            stop
        chance of 50%:
            send "&aHai scavato 100 blocchi! Ma purtroppo non hai vinto una &6Minebomb&a!"
            stop
 
code_language.skript:
on mine:
    if {minedblocks.%player%} is not set:
        set {minedblocks.%player%} to 0
    add 1 to {minedblocks.%player%}
    if {minedblocks.%player%} is 100:
        set {minedblocks.%player%} to 0
        if random integer between 0 and 1 is 0:
            execute console command "giveminebomb %player% 1"
            send "&aHai scavato 100 blocchi! Ti abbiamo regalato una &6Minebomb&a!"
            stop
        else:
            send "&aHai scavato 100 blocchi! Ma purtroppo non hai vinto una &6Minebomb&a!"
            stop
 
Status
Not open for further replies.