Loot Chest

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

Status
Not open for further replies.

IDuckz_

Active Member
Jul 25, 2019
106
2
18
Loot Chest Skript

How do I make a loot chest skript? Like whenever you open it, you get like emeralds or something, and its 1 time use, and I want all players to be able to use it, not like once a player opens it and then its taken, no I want it all players to be able to use it with crit particles, please show me how.
 
Name a chest "&4Loot Chest" and then place it on the ground :emoji_slight_smile:
(Essentials command to get the chest: /i chest 1 name:&4Loot_Chest)
Code:
on rightclick on chest:
    if name of chest is "&4Loot Chest":
        if {lootChestAccess.%player%} is not set:
            set {lootChestAccess.%player%} to true
        if {lootChestAccess.%player%} is true:
            set {lootChestAccess.%player%} to false
        else:
            send "&cYou've already opened a Loot Chest!"
            stop
        open inventory with 1 row named "&4Loot Chest" to player
        wait 1 tick
        set slot 5 of current inventory of player to emerald
 
Name a chest "&4Loot Chest" and then place it on the ground :emoji_slight_smile:
(Essentials command to get the chest: /i chest 1 name:&4Loot_Chest)
Code:
on rightclick on chest:
    if name of chest is "&4Loot Chest":
        if {lootChestAccess.%player%} is not set:
            set {lootChestAccess.%player%} to true
        if {lootChestAccess.%player%} is true:
            set {lootChestAccess.%player%} to false
        else:
            send "&cYou've already opened a Loot Chest!"
            stop
        open inventory with 1 row named "&4Loot Chest" to player
        wait 1 tick
        set slot 5 of current inventory of player to emerald

Prob best to use a location instead of name of the chest to check if it's the chest.
 
Status
Not open for further replies.