Untitled

 avatar
unknown
plain_text
16 hours ago
934 B
2
Indexable
command /getdiamond [<offlineplayer>]:
    trigger:
        if arg-1 is set:
            set {_player} to arg-1
        else:
            set {_player} to player

        # Count player's dirt and sand
        set {_dirt} to amount of dirt in {_player}'s inventory
        set {_sand} to amount of sand in {_player}'s inventory
        set {_total} to {_dirt} + {_sand}

        if {_total} >= 10:
            # Remove exactly 10 items
            if {_dirt} >= 10:
                remove 10 of dirt from {_player}
            else:
                remove {_dirt} of dirt from {_player}
                remove (10 - {_dirt}) of sand from {_player}

            # Always give a diamond/can be changed to give a random chance
            give 1 diamond to {_player}
            send "&aYou got a diamond!" to {_player}
        else:
            send "&cYou need a total of 10 dirt/sand to try this!" to {_player}
Editor is loading...
Leave a Comment