kjfalkeiae

TimeAttack

Mar 14th, 2019
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.48 KB | None | 0 0
  1. command /tastart [<player>]:
  2. trigger:
  3. if player does not have permission "ta.start":
  4. send "&cあなたは「&ata.start&c」の権限を持っていないため、タイムアタックの開始を行うことができません。"
  5. stop
  6. set {_player} to arg 1
  7. if arg 1 is not set:
  8. set {_player} to player
  9. if {_player} is flying:
  10. send "&c対象のプレイヤーは飛行中です。飛行中はタイムアタックを行うことができません。"
  11. stop
  12. if {_player}'s gamemode is creative:
  13. send "&c対象のプレイヤーのゲームモードはクリエイティブです。"
  14. send "&cタイムアタックは、サバイバル、アドベンチャーのどちらかで行う必要があります。"
  15. stop
  16. if {_player}'s gamemode is spectator:
  17. send "&c対象のプレイヤーのゲームモードはスペクテイターです。"
  18. send "&cタイムアタックは、サバイバル、アドベンチャーのどちらかで行う必要があります。"
  19. stop
  20. if {%{_player}%.ta} is true:
  21. send "&eタイムをリセットしました!" to {_player}
  22. set {%{_player}%.minutes} to 0
  23. set {%{_player}%.seconds} to 0
  24. stop
  25. send "&bタイムアタックをスタートしました!" to {_player}
  26. set {%{_player}%.minutes} to 0
  27. set {%{_player}%.seconds} to 0
  28. set {%{_player}%.ta} to true
  29.  
  30. command /taend [<player>]:
  31. trigger:
  32. if player does not have permission "ta.end":
  33. send "&cあなたは「&ata.end&c」の権限を持っていないため、タイムアタックの終了を行うことができません。"
  34. stop
  35. set {_player} to arg 1
  36. if arg 1 is not set:
  37. set {_player} to player
  38. if {%{_player}%.ta} is not true:
  39. send "&cプレイヤーはタイムアタックを行っていません。"
  40. send "&d/tastart&cでタイムアタックを開始できます。"
  41. stop
  42. send "&bタイムアタック終了!" to {_player}
  43. send "&b今回のタイム:&e%{%{_player}%.minutes}%&b分&e%{%{_player}%.seconds}%&b秒" to {_player}
  44. set {%{_player}%.minutes} to 0
  45. set {%{_player}%.seconds} to 0
  46. set {%{_player}%.ta} to false
  47.  
  48. every second:
  49. loop all players:
  50. if {%loop-player%.ta} is true:
  51. add 1 to {%loop-player%.seconds}
  52. if {%loop-player%.seconds} is 60:
  53. set {%loop-player%.seconds} to 0
  54. add 1 to {%loop-player%.minutes}
  55.  
  56. on flight toggle:
  57. wait 1 tick
  58. player is flying
  59. if {%player%.ta} is true:
  60. send "&cタイムアタックを終了しました!タイムアタック中の飛行は禁止されています!" to player
  61. set {%player%.minutes} to 0
  62. set {%player%.seconds} to 0
  63. set {%player%.ta} to false
  64.  
  65. on gamemode change:
  66. if {%player%.ta} is true:
  67. send "&cタイムアタックを終了しました!タイムアタック中にゲームモードを変更してはいけません!" to player
  68. set {%player%.minutes} to 0
  69. set {%player%.seconds} to 0
  70. set {%player%.ta} to false
  71.  
  72. on quit:
  73. if {%player%.ta} is true:
  74. set {%player%.minutes} to 0
  75. set {%player%.seconds} to 0
  76. set {%player%.ta} to false
Advertisement
Add Comment
Please, Sign In to add comment