Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- Pre: &e[&bTeamInv&e]&f
- command /teaminventory [<text>]:
- permission: skript.op
- trigger:
- if arg-1 is "on":
- set {teaminventory} to true
- message "{@Pre} Team inventory enabled"
- execute player command "team autodelete off"
- stop
- if arg-1 is "off":
- delete {teaminventory}
- message "{@Pre} Team inventory disabled"
- execute player command "team autodelete on"
- stop
- if arg-1 is "reset":
- loop all players:
- clear loop-player's ender chest
- delete {teaminv::*}
- message "{@Pre} Team inventories reset"
- stop
- if arg-1 is "help":
- message "{@Pre} /teaminventory <&6on&f/&6off&f/&6reset&f>"
- stop
- else:
- execute player command "teaminventory help"
- command /teaminv:
- aliases: /ti
- trigger:
- if {teaminventory} is true:
- if {TeamNumber::%player%} is not set:
- open the player's ender chest to the player
- stop
- else:
- if {teaminv::%{TeamNumber::%player%}%} is not set:
- open the player's ender chest to the player
- set {teaminv::%{TeamNumber::%player%}%} to "%command sender%" parsed as offline player
- stop
- else:
- open {teaminv::%{TeamNumber::%player%}%}'s ender chest to the player
- else:
- message "Team inventory is disabled"
- on death of player:
- if {teaminventory} is true:
- if {TeamNumber::%victim%} is not set:
- set {_ender} to the victim's ender chest
- set {_deathloc} to the block above the victim
- set the block at {_deathloc} to a chest
- set the inventory of the block at {_deathloc} to {_ender}
- stop
- else:
- if size of {Team.%{TeamNumber::%victim%}%::*} is greater than 1:
- execute console command "/team kick %victim%"
- stop
- else:
- set {_ender} to {teaminv::%{TeamNumber::%victim%}%}'s ender chest
- set {_deathloc} to the block above the victim
- set the block at {_deathloc} to a chest
- set the inventory of the block at {_deathloc} to {_ender}
Advertisement
Add Comment
Please, Sign In to add comment