Solved Auto sell Chest 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!

Status
Not open for further replies.

MaraCZSK

New Member
Oct 3, 2021
5
0
1
24
Code:
Script Version: Bensku's fork 2.2dev36
Script Author: Bensku
Minecraft Version: 1.8
Full Code:

on place of chest:
    if name of player's tool is "&2Auto Sell Chest":
        if {Sellchest::%player%::*} is not set:
            add event-block's location to {Sellchest::%player%::*}
            send "&6AutoSell - Placed chest."
        else:
            send "&6AutoSell - You have an AutoSell Chest!"
            cancel event

on break of chest:
    if {Sellchest::%player%::*} contains event-block's location:
        remove {Sellchest::%player%::*} from {Sellchest::%player%::*}
        send "&6AutoSell - &cAutosell chest destroyed."

every 10 seconds:
    loop all players:
        loop {Sellchest::%loop-players%::*}:
            loop dropped items in radius 10 around loop-value-2:
                set {_it} to name of item of loop-value-3
                broadcast "%{_it}%"
command /ChestGive:
    trigger:
        player is op:
            give chest named "&2Auto Sell Chest" to player
 
 
 
Errors on Reload: None
 
 
Console Errors: None
 
Addons using : Skrayfall v1.9.2, SkBee v1.10.2, Skellet v1.9.6, Ersatz 1.0
 
Have you tried searching the docs? Yes
Have you tried searching the Forums? Yes
What other methods have you tried to fix it?
 
You're looping the dropped item entity and not the item itself. Use
Code:
name of item of loop-value-3
Also, items don't have names by default. If you don't give an item a name it will show as <none>.
 
Status
Not open for further replies.