7mm

【Skript】チェックポイントスクリプト

7mm
Feb 23rd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #===============================================
  2. #/createcheckpointコマンド
  3. #===============================================
  4. command /createcheckpoint <text> <text>:
  5. description: 運営用のコマンドです
  6. usage: &e/ccp <アスレ名> <チェック名>
  7. aliases: /ccp
  8. permission: skript.admin
  9. permission message: &c実行失敗:権限を持っていません
  10. trigger:
  11. execute player command "/hd create CP_%arg 1%_%arg 2%"
  12. execute player command "/hd setline CP_%arg 1%_%arg 2% 1 &d&l-Check&6&lPoint-"
  13. execute player command "/hd addline CP_%arg 1%_%arg 2% &7[%arg 1%]"
  14. execute player command "/setblock ~ ~-1 ~ redstone_lamp"
  15. add 1 to {CP-Amount}
  16. set {PlayerLocation} to location of player
  17. set {PlayerLocation} to round({PlayerLocation})
  18. set {CP-Number.%{CP-Amount}%} to {PlayerLocation}
  19. set {CP-Name.%{CP-Amount}%} to arg 1
  20.  
  21. #===============================================
  22. #/checkpointコマンド
  23. #===============================================
  24. command /checkpoint [<text>]:
  25. description: チェックポイントへTPします
  26. usage: &e/cp [アスレ名] (アスレ名を入力しなかった場合は最後に設定したCPへTPします)
  27. aliases: /cp
  28. trigger:
  29. teleport player to {PlayerCP.%{CP-Name.%arg 1%}%}
  30.  
  31. #===============================================
  32. #/testコマンド
  33. #===============================================
  34. command /test:
  35. trigger:
  36. message "test:%{CP-Amount}%,%{CP-Number.2}%,%{CP-Name.2}%,%{PlayerLocation}%"
  37.  
  38. #===============================================
  39. #チェックポイント設定
  40. #===============================================
  41. on rightclick on redstone_lamp:
  42. loop {CP-Amount} times:
  43. set {PlayerLocation} to location of player
  44. set {PlayerLocation} to round({PlayerLocation})
  45. if {CP-Number.%loop-number%} is {PlayerLocation}:
  46. set {PlayerCP.%{CP-Name.%loop-number%}%} to {CP-Number.%loop-number%}
  47. message "&e&l[cp] &6&lチェックポイントを設定しました&7&o(%{CP-Name.%loop-number%}%)"
  48. else:
  49. message "&e&l[cp] &6&lチェックポイントの設定に失敗しました&7&o(%{CP-Name.%loop-number%}%)"
Add Comment
Please, Sign In to add comment