Searched Around and Cant Find a Way to keep inventory slot 1

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

abctmtom

Member
Aug 15, 2017
12
0
0
25
Ok so my goal is to keep the first slot of a players inventory i can make it so the player keeps all thier inventory with the skript below but is there any way to limit this to the players first inventory slot.

on death of player:
clear drops
set {item1::%victim%::*} to items in player's inventory​

on respawn:
add {item1::%player%::*} to player's inventory​
 
code_language.skript:
on death of player:
    clear drops
    set {item1::%victim%} to slot 0 of victim's inventory

on respawn:
    wait 1 tick
    set slot 0 of player's inventory to {item1::%player%}
 
code_language.skript:
on death of player:
    clear drops
    set {item1::%victim%} to slot 0 of victim's inventory

on respawn:
    wait 1 tick
    set slot 0 of player's inventory to {item1::%player%}
thank that works sorry to ask one more question is there any way to only clear drop on the {item1::%victim%} and let the rest of the drops drop
 
Using @NewbyZ 's code:

code_language.skript:
on death of player:
    remove slot 0 of victim's inventory from drops
    set {item1::%victim%} to slot 0 of victim's inventory

on respawn:
    wait 1 tick
    set slot 0 of player's inventory to {item1::%player%}
 
Status
Not open for further replies.