Oxalist

Staff CP Skript

Nov 18th, 2018 (edited)
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. command /staff:
  2. permission: staffmode.use
  3. trigger:
  4. if {staffmode::%player%} is not set:
  5. set {staffmode::%player%} to true
  6. send "&bYou have turned staff mode &aON" to player
  7. saveinv(player)
  8. clear player's inventory
  9. set slot 1 of player's inventory to stick named "&e&lCheck CPS"
  10. loop all players:
  11. if loop-player does not have permission "staffmode.use":
  12. hide player from loop-player
  13. else if {staffmode::%player%} is true:
  14. delete {staffmode::%player%}
  15. send "&bYou have turned staff mode &cOFF" to player
  16. reveal player to all players
  17. giveinv(player)
  18.  
  19. on join:
  20. if {staffmode::%player%} is true:
  21. giveinv(player)
  22. delete {staffmode::%player%}
  23.  
  24.  
  25.  
  26. function saveinv(p: player):
  27. set {_count} to 0
  28. loop 36 times:
  29. set {inv.%{_p}%.%{_count}%.main} to slot {_count} of {_p}'s inventory
  30. add 1 to {_count}
  31. set {inv.%{_p}%.helmet.main} to {_p}'s helmet
  32. set {inv.%{_p}%.chest.main} to {_p}'s chestplate
  33. set {inv.%{_p}%.legs.main} to {_p}'s leggings
  34. set {inv.%{_p}%.feet.main} to {_p}'s boots
  35.  
  36.  
  37. function giveinv(p: player):
  38. clear {_p}'s inventory
  39. wait 1 tick
  40. set {_count} to 0
  41. loop 36 times:
  42. set slot {_count} of {_p}'s inventory to {inv.%{_p}%.%{_count}%.main}
  43. add 1 to {_count}
  44. set the helmet of {_p} to {inv.%{_p}%.helmet.main}
  45. set the chestplate of {_p} to {inv.%{_p}%.chest.main}
  46. set the leggings of {_p} to {inv.%{_p}%.legs.main}
  47. set the boots of {_p} to {inv.%{_p}%.feet.main}
  48.  
  49. on rightclick:
  50. if target player is set:
  51. if player is holding a stick named "&e&lCheck CPS":
  52. send "&bClicks: &2%{clicks::%target player%}%" to player
  53.  
  54. every second:
  55. loop all players:
  56. set {clicks::%loop-player%} to 0
  57.  
  58. on click:
  59. add 1 to {clicks::%player%}
  60.  
  61. on damage:
  62. add 1 to {clicks::%attacker%}
Add Comment
Please, Sign In to add comment