(SOLVED) clearing all blocks a player placed on death

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

completeidiot

Member
May 5, 2024
38
1
8
18
so i just need a skript that can set all of the green concrete a player placed to light gray stained glass on death

not everyone's concrete, just the person who died's placed concrete
you do not need the full skript as there is no errors and i just need a skript that can make all the green concrete a player placed set to light gray stained glass when the player dies
 
So you would have to track all the concrete the player placed. I would use the place event for that. Then i would store the block is a variable like {concrete::%player's uuid%::*}. Then in a death event you could loop the variable and set loop-block to glass
 
So you would have to track all the concrete the player placed. I would use the place event for that. Then i would store the block is a variable like {concrete::%player's uuid%::*}. Then in a death event you could loop the variable and set loop-block to glass
wouldn't it be better if you added the location of the placed block to {concrete::%player's uuid%::*}, then in a death event you loop that variable and set the location of the placed block to glass if that location still has the block placed
 
how would i set the block to light gray stained glass i tried set {placed::%player's uuid%::*} to light gray stained glass and
set all blocks of {placed::%player's uuid%::*} to light gray stained glass and no errors but it doesnt remove the block or set it to light gray stained glass
 
1716284055845.png
 
Code:
on join:
    set join message to "&7[&a+&7] &8%player%"
    execute console command "/kill %player%"
    set {genprice::%player's uuid%} to 1
    set {multiprice::%player's uuid%} to 200
    set {rgb::%player's uuid%} to true
    set {multiplier::%player's uuid%} to 1

on leave:
    set leave message to "&7[&c-&7] &8%player%"

on death:
    set death message to ""

on first join:
    set {multiplier::%player's uuid%} to 1
    give player fletching table named "&eMarket" with lore "" and "&a&l| &7Purchase Items"
    give player green concrete named "&2Money Gen" with lore "" and "&a&l| &7Generates &aMoney"

on respawn:
    wait 0.05 seconds
    clear player's inventory
    set {money::%player's uuid%} to 0
    give player fletching table named "&eMarket" with lore "" and "&a&l| &7Purchase Items"
    give player green concrete named "&2Money Gen" with lore "" and "&a&l| &7Generates &aMoney"
    set {genprice::%player's uuid%} to 1
    set {multiprice::%player's uuid%} to 200
    set {multiplier::%player's uuid%} to 1
    loop {placed::%player's uuid%::*}:
        set loop-block to light gray stained glass

command /allitems <player>:
    permission: op
    trigger:
        give arg-1 fletching table named "&eMarket" with lore "" and "&a&l| &7Purchase Items"
        give arg-1 green concrete named "&2Money Gen" with lore "" and "&a&l| &7Generates &aMoney"
        give arg-1 gold block named "&eMoney Booster" with lore "" and "&a&l| &7Increases &bMultiplier &7by 0.5"

command /m:
    permission: op
    trigger:
        give player gold block named "&eMoney Booster" with lore "" and "&a&l| &7Increases &bMultiplier &7by 0.5"

#---------------------------------------------------------------------------------------------------------------------------------

on place of green concrete:
    if block below event-block is light gray stained glass:
        cancel event
        set block below event-block to green concrete
        subtract 1 of green concrete from player
        set {_drop} to event-block
        add {_drop} to {drops::*}
        set {_placed} to block below event-block
        add {_placed} to {blocks::%player's uuid%::*}
    else:
        cancel event

on right click:
    if event-block is green concrete:
        set event-block to light gray stained glass
        remove block above event-block from {drops::*}
        give player green concrete named "&2Money Gen" with lore "" and "&a&l| &7Generates &aMoney"

every 1 second:
    drop 1 paper named "&a$1" at {drops::*}

on pickup of paper:
    wait 0.05 seconds
    increase {money::%player's uuid%} by amount of paper in player's inventory * {multiplier::%player's uuid%}
    remove all paper from player's inventory

on break of green concrete:
    cancel event

on break of light gray stained glass:
    if player's gamemode is not creative:
        cancel event

on break of gray stained glass:
    if player's gamemode is not creative:
        cancel event

on break of green stained glass:
    if player's gamemode is not creative:
        cancel event

on break of lime stained glass:
    if player's gamemode is not creative:
        cancel event

on place of gold block:
    cancel event

on right click:
    if name of tool of player is "&eMoney Booster":
        subtract 1 of gold block from player's inventory
        increase {multiplier::%player's uuid%} by 0.5
        set action bar of player to "&eYour &b&lMultiplier &eIs Now &l%{multiplier::%player's uuid%}%."

#-----------------------------------------------------------------------------------------------------------------------
    
command /fix:
    trigger:
        delete {drops::*}

command /money [<player>]:
    trigger:
        if arg-1 is set:
            send {money::%arg-1's uuid%} to player
        else:
            send {money::%player's uuid%} to player

command /clearmoney [<player>]:
    permission: op
    trigger:
        if arg-1 is set:
            set {money::%arg-1's uuid%} to 0
        else:
            set {money::%player's uuid%} to 0

command /invsee <player>:
    permission: op
    trigger:
        open arg-1's inventory to player

command /multifix [<player>]:
    permission: op
    trigger:
        if arg-1 is set:
            set {multiplier::%arg-1's uuid%} to 1
        else:
            set {multiplier::%player's uuid%} to 1
#----------------------------------------------------------------------------------------------------------------------------


every 1 second:
    loop all players:
        set {gen::%loop-player's uuid%} to green concrete named "&2Money Gen" with lore "" and "&a&l| &7Generates &aMoney" and "" and "&aCosts &2%{genprice::%loop-player's uuid%}%"
        set {multi::%loop-player's uuid%} to gold block named "&eMoney Booster" with lore "" and "&a&l| &7Increases &bMultiplier &7by 0.5" and "" and "&aCosts &2%{multiprice::%loop-player's uuid%}%"

on right click:
    if clicked block is fletching table:
        open virtual chest inventory with 5 rows named "&eMarket" to player
        set slot 0 of player's current inventory to yellow stained glass named "&eClick These Items To Change Shop Page! ->" with lore "&8Welcome %player%!"
        set slot 1 of player's current inventory to sunflower of mending named "&fMoney Generation" with lore "&8Welcome %player%!"
        set slot 9 and 10 and 11 and 12 and 13 and 14 and 15 and 16 and 17 of player's current inventory to yellow glazed terracotta named "&7Categories ↑ " with lore "&7Upgrades ↓"
        set slot 18 of player's current inventory to green concrete named "&2Money Gen" with lore "" and "&a&l| &7Generates &aMoney" and "" and "&aCosts &2%{genprice::%player's uuid%}%"
        set slot 19 of player's current inventory to gold block named "&eMoney Booster" with lore "" and "&a&l| &7Increases &bMultiplier &7by 0.5" and "" and "&aCosts &2%{multiprice::%player's uuid%}%"

on inventory click:
    if event-inventory is not player's inventory:
        close player's inventory
        if clicked slot contains {gen::%player's uuid%}:
            if {money::%player's uuid%} is above {genprice::%player's uuid%}:
                subtract {genprice::%player's uuid%} from {money::%player's uuid%}
                set {genprice::%player's uuid%} to {genprice::%player's uuid%} + {genprice::%player's uuid%} / 2
                give player green concrete named "&2Money Gen" with lore "" and "&a&l| &7Generates &aMoney"
            else:
                send "&cYou do not have enough money for that!" to player

on inventory click:
    if event-inventory is not player's inventory:
        close player's inventory
        if clicked slot contains {multi::%player's uuid%}:
            if {money::%player's uuid%} is above {multiprice::%player's uuid%}:
                subtract {multiprice::%player's uuid%} from {money::%player's uuid%}
                set {multiprice::%player's uuid%} to {multiprice::%player's uuid%} + {multiprice::%player's uuid%} + 0.5
                give player gold block named "&eMoney Booster" with lore "" and "&a&l| &7Increases &bMultiplier &7by 0.5"
            else:
                send "&cYou do not have enough money for that!" to player

on left click:
    if clicked block is fletching table:
        set event-block to air
        give player fletching table named "&eMarket" with lore "" and "&a&l| &7Purchase Items"

command /genprice:
    trigger:
        send "%{genprice::%player's uuid%}%" to player
#-----------------------------------------------------------------------------------------------------------------------------------

command /rgb:
    trigger:
        if {rgb::%player's uuid%} is true:
            set {rgb::%player's uuid%} to false
        else:
            set {rgb::%player's uuid%} to true

on join:
    while player is online:
        if {rgb::%player's uuid%} is true:
            set title of player's scoreboard to "&cMoney&6Fight&eIg &e:DD"
        else:
            set title of player's scoreboard to "&cMo&6ne&eyF&aig&2ht&bIg&9 :D&d :)"
        set line 1 of player's scoreboard to "&a "
        set line 2 of player's scoreboard to "&7Player: &6%player%"
        set line 3 of player's scoreboard to "&7Money: &a%{money::%player's uuid%}%"
        set line 4 of player's scoreboard to "&bMultiplier: &e%{multiplier::%player's uuid%}%"
        set line 5 of player's scoreboard to "&7Server Ip: &6moneyfightig.feathermc.gg"
        wait 1 second
 
Make sure you use the same variable. You used placed one time and blocks a different time
 
ty also i had to remove the thing that spawns the paper but yea its the same thing just diff variable and block above