Veinminer

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

BoxMiners

Member
Jul 19, 2022
47
0
6
18
Code:
options:
    pfv: &8[&a&lVein&e&lMiner&8]
    
on rightclick with acacia sapling:
    if name of player's held item is "&cVeinMiner Activator":
        cancel event
        send "{@pfv}&a Activated &eVeinminer"
        set {veinminer::%player%} to true
        wait 7 seconds
        delete {veinminer::%player%}
        

on break:
    if name of event-block contains "ore":
        if {veinminer::%player%} is set:
            set {_vein} to event-block
            wait 3 ticks
            loop all blocks in radius 3 of {_vein}:
                set {_veins} to loop-blocks
                if {_veins} = {_vein}:
                    break {_veins}
                    delete {veinminer::%player%}

The Upper part works, just when i use it the blocks doesnt break
anyone know why, please comment, i'll be gratefull

(no errors on reload)
 
This should work:
Code:
on break:
   
    set {_origin} to "%type of event-block%"
    set {_oLoc} to location of event-block

    if {_origin} contains "ore":
       
        loop all blocks in radius 3 around {_oLoc}:
       
            set {_target} to "%type of loop-block%"
            set {_tLoc} to location of loop-block
           
            if {_origin} is {_target}:
           
                break block at {_tLoc}
However, this can only destroy a limited number of ore. If you want to make it truly "vein", you may need to repeatedly check whether there are similar ores around the target ore.
 
This should work:
Code:
on break:
  
    set {_origin} to "%type of event-block%"
    set {_oLoc} to location of event-block

    if {_origin} contains "ore":
      
        loop all blocks in radius 3 around {_oLoc}:
      
            set {_target} to "%type of loop-block%"
            set {_tLoc} to location of loop-block
          
            if {_origin} is {_target}:
          
                break block at {_tLoc}
However, this can only destroy a limited number of ore. If you want to make it truly "vein", you may need to repeatedly check whether there are similar ores around the target ore.
It works, thank you
 
Status
Not open for further replies.