Solved Help me

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

novastosha

Well-Known Member
Jan 11, 2019
344
22
18
28
SkUnity Street
How to set blocks to diffirent blocks?
Read code to know:
Code:
command prisoncore [<text>] [<text>] [<text>] [<number>] [<player>]:
    trigger:
        if arg 1 is "mine":
            if arg 2 is "set" or "wand":
                give player blaze rod named "§aPrisonCore (Mine)"
                PC_SendMessage(player, "correct", "Mine wand given to you")
                set {_pos1.%player%} to true
            if arg 2 is "reset":
                loop blocks within {Pc.mine::pos::1} to {Pc.mine::pos::2}:
                    set loop-block to emerald block and tnt
[doublepost=1557599311,1557578985][/doublepost]Help ;(
 
Hey, this might not be of any relevance to your issue but, the best way to make a "mine reset" would prob be to use Skematic addon or even FaweSK. They both use FAWE as a base, the syntax is easy, and its very fast (non laggy). Here is an example done with Skematic:

Code:
set {_region} to a new cuboidregion from {Pc.mine::pos::1} to {Pc.mine::pos::2}
set all blocks in {_region} to %itemtypes%

As for setting it to multiple block types, I am not completely sure but you can try this:
Code:
set all blocks in {_region} to emerald block and tnt
 
Hey, this might not be of any relevance to your issue but, the best way to make a "mine reset" would prob be to use Skematic addon or even FaweSK. They both use FAWE as a base, the syntax is easy, and its very fast (non laggy). Here is an example done with Skematic:

Code:
set {_region} to a new cuboidregion from {Pc.mine::pos::1} to {Pc.mine::pos::2}
set all blocks in {_region} to %itemtypes%

As for setting it to multiple block types, I am not completely sure but you can try this:
Code:
set all blocks in {_region} to emerald block and tnt
I need WorldGuard?
 
How to set blocks to diffirent blocks?
Read code to know:
Code:
command prisoncore [<text>] [<text>] [<text>] [<number>] [<player>]:
    trigger:
        if arg 1 is "mine":
            if arg 2 is "set" or "wand":
                give player blaze rod named "§aPrisonCore (Mine)"
                PC_SendMessage(player, "correct", "Mine wand given to you")
                set {_pos1.%player%} to true
            if arg 2 is "reset":
                loop blocks within {Pc.mine::pos::1} to {Pc.mine::pos::2}:
                    set loop-block to emerald block and tnt
[doublepost=1557599311,1557578985][/doublepost]Help ;(
Although I have not tried it, did you try with ?:
code_language.skript:
command prisoncore [<text>] [<text>] [<text>] [<number>] [<player>]:
    trigger:
        if arg 1 is "mine":
            if arg 2 is "set" or "wand":
                give player blaze rod named "§aPrisonCore (Mine)"
                PC_SendMessage(player, "correct", "Mine wand given to you")
                set {_pos1.%player%} to true
            if arg 2 is "reset":
                loop blocks between {Pc.mine::pos::1} and {Pc.mine::pos::2}:
                    set loop-block to emerald block and tnt
 
Although I have not tried it, did you try with ?:
code_language.skript:
command prisoncore [<text>] [<text>] [<text>] [<number>] [<player>]:
    trigger:
        if arg 1 is "mine":
            if arg 2 is "set" or "wand":
                give player blaze rod named "§aPrisonCore (Mine)"
                PC_SendMessage(player, "correct", "Mine wand given to you")
                set {_pos1.%player%} to true
            if arg 2 is "reset":
                loop blocks between {Pc.mine::pos::1} and {Pc.mine::pos::2}:
                    set loop-block to emerald block and tnt
Not working (between setting distance between not by m2)
 
xD just kidding calm Down bro
[doublepost=1557608599,1557608334][/doublepost]Not working :emoji_frowning:
[doublepost=1557643971][/doublepost]
Hey, this might not be of any relevance to your issue but, the best way to make a "mine reset" would prob be to use Skematic addon or even FaweSK. They both use FAWE as a base, the syntax is easy, and its very fast (non laggy). Here is an example done with Skematic:

Code:
set {_region} to a new cuboidregion from {Pc.mine::pos::1} to {Pc.mine::pos::2}
set all blocks in {_region} to %itemtypes%

As for setting it to multiple block types, I am not completely sure but you can try this:
Code:
set all blocks in {_region} to emerald block and tnt

Giving me error in console (A FAWE event is broke,n RIP)
[doublepost=1557644003][/doublepost]Not Sure
[doublepost=1557940113][/doublepost]If somone has a souliton please help
 
Code:
function getBlocks(1: location, 2: location) :: blocks:
    set {_x} to 1
    set {_y} to 1
    set {_z} to 1
    if x coord of {_1} > x coord of {_2}:
        set {_x} to -1
    if y coord of {_1} > y coord of {_2}:
        set {_y} to -1
    if z coord of {_1} > z coord of {_2}:
        set {_z} to -1
    set {_base1} to {_1}
    loop abs(x coord of {_1} - x coord of {_2}) + 1 times:
        loop abs(z coord of {_1} - z coord of {_2}) + 1 times:
            loop abs(y coord of {_1} - y coord of {_2}) + 1 times:
                add 1 to {_current}
                set {_b::%{_current}%} to block at {_1}
                add {_y} to y coord of {_1}
            add {_z} to z coord of {_1}
            set y coord of {_1} to y coord of {_base1}
        add {_x} to x coord of {_1}
        set z coord of {_1} to z coord of {_base1}
    return {_b::*}
command /resetmine <text>: #this is the mine i had, eg. A, B, etc..
    trigger:
        add 1 to y coord of {loc1::%arg-1%} #{loc1} and {loc2... are the locations of the region i set
        set {_x::*} to getBlocks({loc1::%arg-1%}, {loc2::%arg-1%})
        loop {_x::*}:
            set {_block} to a random element out of {blocks::%arg-1%::*}
            set block at location of loop-value to {_block}
command /addblock <text> <text>:
    trigger:
        set {_block} to arg-2 parsed as item
        add {_block} to {blocks::%arg-1%::*} #arg-1 is the mine, A, B, etc, I had something to select the region with sticks but I'm sure you could figure it out
        message "&6&l(!) &6Added &e%arg-2% &6to &e%arg-1% &6mine!"

This is something I threw together a while back, with the help of some on here.
Take what you need from it.
/addblock <mine> <block> is just something to add the blocks you want the mine to consist of, you can add better code.
 
Code:
function getBlocks(1: location, 2: location) :: blocks:
    set {_x} to 1
    set {_y} to 1
    set {_z} to 1
    if x coord of {_1} > x coord of {_2}:
        set {_x} to -1
    if y coord of {_1} > y coord of {_2}:
        set {_y} to -1
    if z coord of {_1} > z coord of {_2}:
        set {_z} to -1
    set {_base1} to {_1}
    loop abs(x coord of {_1} - x coord of {_2}) + 1 times:
        loop abs(z coord of {_1} - z coord of {_2}) + 1 times:
            loop abs(y coord of {_1} - y coord of {_2}) + 1 times:
                add 1 to {_current}
                set {_b::%{_current}%} to block at {_1}
                add {_y} to y coord of {_1}
            add {_z} to z coord of {_1}
            set y coord of {_1} to y coord of {_base1}
        add {_x} to x coord of {_1}
        set z coord of {_1} to z coord of {_base1}
    return {_b::*}
command /resetmine <text>: #this is the mine i had, eg. A, B, etc..
    trigger:
        add 1 to y coord of {loc1::%arg-1%} #{loc1} and {loc2... are the locations of the region i set
        set {_x::*} to getBlocks({loc1::%arg-1%}, {loc2::%arg-1%})
        loop {_x::*}:
            set {_block} to a random element out of {blocks::%arg-1%::*}
            set block at location of loop-value to {_block}
command /addblock <text> <text>:
    trigger:
        set {_block} to arg-2 parsed as item
        add {_block} to {blocks::%arg-1%::*} #arg-1 is the mine, A, B, etc, I had something to select the region with sticks but I'm sure you could figure it out
        message "&6&l(!) &6Added &e%arg-2% &6to &e%arg-1% &6mine!"

This is something I threw together a while back, with the help of some on here.
Take what you need from it.
/addblock <mine> <block> is just something to add the blocks you want the mine to consist of, you can add better code.

Nice but how can i set the blocks t o multipile ones
 
Status
Not open for further replies.