Solved Remove random item from player inventory and add it to your own

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

midniqhts

Member
Oct 28, 2021
1
0
1
25
Can anyone help me with a code that takes a random item from a specified player's inventory and add it to your own?
 
This should work.

Code:
command /removeitem <player>:
    trigger:
        set {_items::*} to all items of argument's inventory
        set {_item} to random item out of {_items::*}
        remove {_item} from arg-1's inventory
        give player 1 of {_item}
        send "&7Took &c%{_item}% &7from %argument%'s inventory."
 
Can anyone help me with a code that takes a random item from a specified player's inventory and add it to your own?
Code:
command /pickpocket <player>:
    trigger:
        loop items of argument-player:
            chance of 1%:
                set {_loot} to loop-item
                remove loop-item from argument-player
                give {_loot} to command sender
 
Status
Not open for further replies.