dropping item at location variable

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

    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!

DannyDaMannyy

Member
Dec 16, 2023
20
1
3
Hey skripters, I'm baffled by this situation. Maybe you guys could help me understand this better? I am attempting to make it so when a netherite block with all 5 stars of power are in the inventory I made for it, a little light show with lightning happens, and then a new star is spawned/dropped at the location of the top of the netherite block, and all 5 other stars cleared from that inventory. I'm having a bit of trouble doing this, however, because:
ISSUES:
1. I dont know how to clear the inventory.
2. The new star does not spawn at all.

OTHER INFO:
Console shows no errors, and when I set up a command (/drop) to drop the star at the location of the player who ran the command, all works well. So something is wrong when its told to spawn the star at the variable location.
Any assistance GREATLY appreciated! -Dan
Code:
on right click:
    if event-block is netherite block:
        set {block} to event-block's location
        add 2 to y-coordinate of {block}
        set {StarComb} to new chest inventory with 1 row named "&6&lCelestial Pedestal"
        open {StarComb} to player
        set {_slot} to 0
        loop 9 times:
            set slot {_slot} of player's current inventory to {pedestal::%{_slot}%}
            add 1 to {_slot}


on inventory close:
    if name of player's current inventory is "&6&lCelestial Pedestal":
        set {_slot} to 0
        loop 9 times:
            set {pedestal::%{_slot}%} to slot {_slot} of player's current inventory
            add 1 to {_slot}
        wait 3 ticks
        if {StarComb} contains 1 nether star named "&cStrength Star":
            if {StarComb} contains 1 nether star named "&bSpeed Star":
                if {StarComb} contains 1 nether star named "&aRegeneration Star":
                    if {StarComb} contains 1 nether star named "&5Resistance Star":
                        if {StarComb} contains 1 nether star named "&1Dolphin's Grace Star":
                            set {celestial} to true                   
                            delete {StarComb}
                            send title "" with subtitle "&6&lCelestial Star created!" to all players
                            play sound "ambient.weather.thunder" at {block}
                            play sound "entity.ender_dragon.death" to all players
                            strike lightning at {block}
                            loop 9 times:
                                set {pedestal::%{_slot}%} to air
                                add 1 to {_slot}
                            wait 1 second
                            strike lightning at {block}
                            wait 2 seconds
                            strike lightning at {block}
                            wait 5 ticks
                            strike lightning at {block}
                            drop 1 nether star named "&6Celestial Star" at {block}
 
Wow. I've never seen skript like this before, so I'm baffled as well. Make sure that the lightning isn't deleting the Nether star. You could try clear {StarComb}. But that's pretty much it. Sorry!