(SOLVED) so uhh help.

  • 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
33
0
6
18
so ive been wanting to make a server with generators and ive been trying to make it so on player death: it removes all of the green concrete the player placed.

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"

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::*}
    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 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} to green concrete named "&2Money Gen" with lore "" and "&a&l| &7Generates &aMoney" and "" and "&aCosts &2%{genprice::%loop-player's uuid%}%"
        set {multi} 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 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 10 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}:
            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}:
            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

this is all of the code... this took me hours to make
 
You can add the concrete to a variable so when the player dies or server stops it deletes all the concrete and then the variable.
 
so ive been wanting to make a server with generators and ive been trying to make it so on player death: it removes all of the green concrete the player placed.

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"

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::*}
    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 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} to green concrete named "&2Money Gen" with lore "" and "&a&l| &7Generates &aMoney" and "" and "&aCosts &2%{genprice::%loop-player's uuid%}%"
        set {multi} 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 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 10 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}:
            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}:
            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

this is all of the code... this took me hours to make
You could easily do this by using on death, checking victim is a player then looping all the items in the player's inventory. If the loop item is the concrete, it will then remove all of that event item from the player.