#setting wrong value

1 messages · Page 1 of 1 (latest)

shy kayak
#
        set {_uuid} to uuid of player
        set {_p} to player
        set {_ploc::%{_uuid}%} to location of player
        {domain::%{_uuid}%} is "&aReady!"
        set {domain::%{_uuid}%} to 240
        message "You have used the power <##008582>⌂ Dark Domain&f! It is now on cooldown for <##008582>4 minutes." to player
        loop blocks in radius 15 of {_ploc::%{_uuid}%}:
            loop-block is air or short grass or tall grass or grass or stone
            set {-originalblock::%loop-block%} to loop-block
            set loop-block to sculk
            loop-block is sculk
            set {-unbreakable::%loop-block%} to true
            
        loop blocks in radius 14 of {_ploc::%{_uuid}%}:
            set {-unbreakable::%loop-block%} to false
            loop-block is sculk
            if {-originalblock::%loop-block%} is not air:
                set loop-block to {-originalblock::%loop-block%}
            else:
                set loop-block to air
            
            
        wait 30 seconds
        
        loop blocks in radius 15 of {_ploc::%{_uuid}%}:
            set {-unbreakable::%loop-block%} to false
            loop-block is sculk
            set loop-block to {-originalblock::%loop-block%}```

it is supposed to summon a hollow sculk sphere with unbreakable sculk blocks as its exterior. but instead the sphere isnt hollow but filled. i found that the reason for this is because the `{-originalblock::%loop-block%}` value is sculk for some reason even though i set that before i set the loop-block to sculk
random lava
#

loop-block is a dynamic reference iirc. set it to type of loop-block

#

and honestly, do something like this:

  if distance between origin and loop-block < R-1:
    continue

  set {-original::%x%::%y%::%z%} to type of loop-block
  set loop-block to sculk```
shy kayak
#

it says it doesnt understand the expression

        set {_uuid} to uuid of player
        set {_p} to player
        set {_ploc::%{_uuid}%} to location of player
        {domain::%{_uuid}%} is "&aReady!"
        set {domain::%{_uuid}%} to 240
        message "You have used the power <##008582>⌂ Dark Domain&f! It is now on cooldown for <##008582>4 minutes." to player
        loop blocks in radius 15 of {_ploc::%{_uuid}%}:
            distance between {_ploc::%{_uuid}%} and loop-block < 15-1
            set {-original::%x%::%y%::%z%} to type of loop-block
            set loop-block to sculk
            loop-block is sculk
            set {-unbreakable::%loop-block%} to true
            
            
        wait 30 seconds
        
        loop blocks in radius 15 of {_ploc::%{_uuid}%}:
            set {-unbreakable::%loop-block%} to false
            distance between {_ploc::%{_uuid}%} and loop-block < 15-1
            loop-block is sculk
            set loop-block to {-original::%x%::%y%::%z%}```
random lava
#

yeah you need to input the coords there

#

or actually just do 2 lists

#

add the type to one, and the location to the second

#

then loop the location list and set the block at loop-value to {_type::%loop-index%}

shy kayak
#
        set {_uuid} to uuid of player
        set {_p} to player
        set {_ploc::%{_uuid}%} to location of player
        {domain::%{_uuid}%} is "&aReady!"
        set {domain::%{_uuid}%} to 240
        message "You have used the power <##008582>⌂ Dark Domain&f! It is now on cooldown for <##008582>4 minutes." to player
        loop blocks in radius 15 of {_ploc::%{_uuid}%}:
            distance between {_ploc::%{_uuid}%} and loop-block < 15-1
            add type of loop-block to {_ogblocks::%{_uuid}%}
            add location of loop-block to {_oglocs::%{_uuid}%::*}
            set loop-block to sculk
            loop-block is sculk
            set {-unbreakable::%loop-block%} to true
            
        wait 30 seconds
        
        loop blocks in radius 15 of {_ploc::%{_uuid}%}:
            set {-unbreakable::%loop-block%} to false
            distance between {_ploc::%{_uuid}%} and loop-block < 15-1
            loop {_oglocs::%{_uuid}%::*}:
                set {_loc} to loop-value-1
                set {_ogtype} to {_ogblocks::%{_uuid}%}
                set block at {_loc} to {_ogtype}``` it makes the sphere but it isnt hollow and lags a lot before its placed
random lava
#

You are only filling radius 14

#

You want to continue (skip an iteration) of the loop if the radius is 14 or less

#

It should be either ```if distance < 14:
continue

place blocksorif distance > 14:
place blocks```

shy kayak
#
            add type of loop-block to {_ogblocks::%{_uuid}%}
            add location of loop-block to {_oglocs::%{_uuid}%::*}
            distance between {_ploc::%{_uuid}%} and loop-block > 14
            set loop-block to sculk
            loop-block is sculk
            set {-unbreakable::%loop-block%} to true
            
        wait 30 seconds
        
        loop blocks in radius 15 of {_ploc::%{_uuid}%}:
            set {-unbreakable::%loop-block%} to false
            distance between {_ploc::%{_uuid}%} and loop-block > 14
            loop {_oglocs::%{_uuid}%::*}:
                set {_loc} to loop-value-1
                set {_ogtype} to {_ogblocks::%{_uuid}%}
                set block at {_loc} to {_ogtype}``` It makes the sphere hollow but it lags the server and kicked me also the sphere didnt go away after 30 seconds like its supposed to
random lava
#

add a wait 1 tick every 50 blocks

#

or 100 or 300

shy kayak
#

the sphere works now and is less laggy but for some reason the blocks all set back to air when it is supposed to set the blocks to how they were

random lava
#

You need to add the type to a list..

#

Also why check for scull after setting it to sculc

shy kayak
#

just to make sure that the sculk are the only unbreakable blocks

random lava
#

But

#

You set it to sculk on the previous line

shy kayak
#

sometimes the other blocks become unbreakable for some reason

#

also when i make it a list it still sets to air ```set {_n1} to 1
loop blocks in radius 15 of {_ploc::%{_uuid}%}:
add type of loop-block to {_ogblocks::%{_uuid}%::}
add location of loop-block to {_oglocs::%{_uuid}%::
}
distance between {_ploc::%{_uuid}%} and loop-block > 14
set loop-block to sculk
loop-block is sculk
set {-unbreakable::%loop-block%} to true
add 1 to {_n1}
if {_n1} is 50:
set {_n1} to 1
wait 1 tick

    wait 30 seconds
    
    set {_un} to 1
    loop blocks in radius 15 of {_ploc::%{_uuid}%}:
        set {-unbreakable::%loop-block%} to false
        distance between {_ploc::%{_uuid}%} and loop-block > 14
        loop {_oglocs::%{_uuid}%::*}:
            set {_loc} to loop-value-1
            set {_ogtype} to {_ogblocks::%{_uuid}%::%loop-value-1%}
            set block at {_loc} to {_ogtype}
        add 1 to {_un}
        if {_un} is 50:
            set {_un} to 1
            wait 1 tick```