#issue with removing gen

1 messages · Page 1 of 1 (latest)

fiery rampart
#
on join:
    set {genplace.cd::%player's uuid%} to false

on first join:
    set {genscap::%player's uuid%} to 50
#---generator dropping---#
every {@GenDropCooldown}:
    drop 1 white dye named "&e&lWhite drop [I]" 0 meters above {white.generator::1::*}
#---Gen Placement---#
    
on place of white concrete:
    name of player's held item is "{@whitegen}":
        if {gens::%player's uuid%} is less than {genscap::%player's uuid%}:    
            add event-block's location to {white.generator::1::*}
            add event-block's location to {blocks.%player's uuid%::1::*}
            add 1 to {gens::%player's uuid%}
            send title "&aSuccessfully placed a Generator!" with subtitle "&8(%{gens::%player's uuid%}%/%{genscap::%player's uuid%}%)" to player
            play sound "entity.experience.orb.pickup" with volume 100 at pitch 1 to player
            make 10 of poof at event-block's location

on left click on white concrete:
    if player is sneaking:
        set event-block to air
        remove event-block's location from {blocks.%player's uuid%::1::*}
        remove event-block's location from {white.generator::1::*}
        give player 1 white concrete named "{@whitegen}"
        send title "&aSuccessfully removed a Generator!" with subtitle "&8(%{gens::%player's uuid%}%/%{genscap::%player's uuid%}%)" to player
        play sound "entity.experience.orb.pickup" with volume 100 at pitch 1 to player
    else:
        cancel event
        send title "&8Shift + Left Click" with subtitle "&cTo Remove a Generator!" to player
        play sound "block.note_block.pling" with volume 100 at pitch 0 to player

command /removegenlocs:
    trigger:
        clear {blocks.%player's uuid%::1::*}
        clear {white.generator::1::*}    ```
strange pasture
#

{blocks.%player's uuid%::1::*}
this hurts

#

try debbuging it

#

on place, send yourself the thing you're saving in the list

#

on remove, send yourself the thing you're trying to remove from the list

#

I feel like you could save variables by not having 2 lists that do the same thing