Solved Timebomb Clear Drops

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

SandyVerse

Active Member
Mar 19, 2017
51
0
0
33
Using this
code_language.skript:
options:
    Perm: uhc.staff
    P: &8[&4TimeBomb&8]
    C: &b
    H: &f
    Excluded: Spawn
    Force: 10

command /TimeBomb <text>:
    permission: {@Perm}
    usage: /TimeBomb <On:Off>
    trigger:
        if arg-1 is "enable" or "on":
            set {TimeBomb} to true
            broadcast "{@P} &fTime Bomb &aEnabled{@C}!"
        if arg-1 is "disable" or "off":
            delete {TimeBomb}
            broadcast "{@P}{@C} &fTime Bomb &cDisabled{@C}!"

on death of player:
    if victim's world is not "Spawn":
        {Timebomb} is true
        set block at block at victim's location to chest
        set {_loc} to the block at victim's location
        set {_chest} to block at victim's location
        set block at block left of {_chest} to chest
        add 1 golden apple named "&6Golden Head" to the block at {_chest}
        add victim's inventory to the block at {_chest}
        add the victim's helmet slot to the inventory of the block at {_chest}
        add the victim's chestplate slot to the inventory of the block at {_chest}
        add the victim's leggings slot to the inventory of the block at {_chest}
        add the victim's boots slot to the inventory of the block at {_chest}
        clear drops
        delete holo object "%victim%"
        create holo object "%victim%" with id "%victim%" at location of block above victim's location
        set {_time.%victim%} to 30
        broadcast "{@P}{@H} &a%victim%'s &fcorpse is now ticking"
        loop 30 times:
            edit holo object "%victim%" line 1 to "&a%{_time.%victim%}% seconds remaining"
            add -1 to {_time.%victim%}
            wait 1 second
        delete holo object "%victim%"
        set block at {_chest} to air
        set block at {_loc} to air
        wait 3 ticks
        create an explosion of force {@Force} at {_chest}
        strike lightning effect at {_chest}
        broadcast "{@P} &a%victim%'s &fcorpse has exploded"
        clear drops at %victim%


How would I clear drops around the explosion after it happened?
 
code_language.skript:
ERROR Can't understand this condition/effect: clear drops at %victim% (Timebomb.sk, line 49: clear drops at %victim%')
 
Simple, just figure out the radius that a force is then loop the dropped items in that radius and delete them. Of course, you'll have to wait a tick.

I was unsure on how to do this, so I tried it out first.
code_language.skript:
        loop all items:
            if loop-item is in 30 radius:
                delete loop-item

Obviously, it didn't work, but I was still unsure on how to do it.
 
I was unsure on how to do this, so I tried it out first.
code_language.skript:
        loop all items:
            if loop-item is in 30 radius:
                delete loop-item

Obviously, it didn't work, but I was still unsure on how to do it.

code_language.skript:
loop items in radius 30 around victim:
    delete loop-item
 
Status
Not open for further replies.