kollinkoko

Team Inventory [SK]

Sep 6th, 2016
774
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. options:
  2. Pre: &e[&bTeamInv&e]&f
  3.  
  4. command /teaminventory [<text>]:
  5. permission: skript.op
  6. trigger:
  7. if arg-1 is "on":
  8. set {teaminventory} to true
  9. message "{@Pre} Team inventory enabled"
  10. stop
  11. if arg-1 is "off":
  12. delete {teaminventory}
  13. message "{@Pre} Team inventory disabled"
  14. stop
  15. if arg-1 is "reset":
  16. loop all players:
  17. clear loop-player's ender chest
  18. delete {teaminv::*}
  19. message "{@Pre} Team inventories reset"
  20. stop
  21. if arg-1 is "help":
  22. message "{@Pre} /teaminventory <&6on&f/&6off&f/&6reset&f>"
  23. stop
  24. else:
  25. player command "teaminventory help"
  26.  
  27. command /teaminv:
  28. aliases: /ti
  29. trigger:
  30. if {teaminventory} is true:
  31. if {Teams.InTeam::%player%} is not set:
  32. open the player's ender chest to the player
  33. stop
  34. else:
  35. if {teaminv::%{Teams.InTeam::%player%}%} is not set:
  36. open the player's ender chest to the player
  37. set {teaminv::%{Teams.InTeam::%player%}%} to "%command sender%" parsed as offline player
  38. stop
  39. else:
  40. open {teaminv::%{Teams.InTeam::%player%}%}'s ender chest to the player
  41. else:
  42. message "Team inventory is disabled"
  43.  
  44. on death of player:
  45. if {teaminventory} is true:
  46. if {Teams.InTeam::%victim%} is not set:
  47. set {_ender} to the victim's ender chest
  48. set {_deathloc} to the block above the victim
  49. set the block at {_deathloc} to a chest
  50. set the inventory of the block at {_deathloc} to {_ender}
  51. stop
  52. else:
  53. if size of {Team.%{Teams.InTeam::%victim%}%::*} is greater than 1:
  54. execute console command "/team makeleave %victim%"
  55. stop
  56. else:
  57. set {_ender} to {teaminv::%{Teams.InTeam::%victim%}%}'s ender chest
  58. set {_deathloc} to the block above the victim
  59. set the block at {_deathloc} to a chest
  60. set the inventory of the block at {_deathloc} to {_ender}
Advertisement
Add Comment
Please, Sign In to add comment