QuacziSK

QGuilds schematy v0.1

Dec 3rd, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.27 KB | None | 0 0
  1. command /gschema [<text>] [<text>]:
  2. permission: qg.admin
  3. permission message: &cNie masz uprawnien.
  4. trigger:
  5. if arg-1 is not set:
  6. give player blaze rod named "&eQ&6Admin"
  7. if arg-1 is "zapisz":
  8. if arg-2 is set:
  9. if file "plugins/QGildie/schematy/%arg-2%.yml" doesn't exists:
  10. set {m::%player%} to true
  11. create file "plugins/QGildie/schematy/%arg-2%.yml"
  12. wait 2 ticks
  13. set {num} to 0
  14. loop blocks within {qg::sel::loc1} to {qg::sel::loc2}:
  15. if loop-block is not air:
  16. add 1 to {num}
  17. set {_xp} to x-coordinate of player
  18. set {_yp} to y-coordinate of player
  19. set {_zp} to z-coordinate of player
  20. set {shloc::%{num}%} to location of loop-block
  21. set {_rxp} to "%x-coordinate of {shloc::%{num}%} - {_xp}%" parsed as number
  22. set {_ryp} to "%y-coordinate of {shloc::%{num}%} - {_yp}%" parsed as number
  23. set {_rzp} to "%z-coordinate of {shloc::%{num}%} - {_zp}%" parsed as number
  24. set x-coordinate of {shloc::%{num}%} to {_rxp}
  25. set y-coordinate of {shloc::%{num}%} to {_ryp}
  26. set z-coordinate of {shloc::%{num}%} to {_rzp}
  27. set {blok::%{num}%} to loop-block
  28. set {bnum} to "b%{num}%"
  29. wait a tick
  30. set "bloki.%{num}%" to "%{blok::%{num}%}%" in yaml file "plugins/QGildie/schematy/%arg-2%.yml"
  31. set "x.%{num}%" to "%{_rxp}%" in yaml file "plugins/QGildie/schematy/%arg-2%.yml"
  32. set "y.%{num}%" to "%{_ryp}%" in yaml file "plugins/QGildie/schematy/%arg-2%.yml"
  33. set "z.%{num}%" to "%{_rzp}%" in yaml file "plugins/QGildie/schematy/%arg-2%.yml"
  34. send "%{qg::opt::prefix}% &aZapisano schemat &e%arg-2%.yml%{qg::opt::suffix}%"
  35. delete {m::%player%}
  36. if arg-1 is "wczytaj":
  37. if arg-2 is set:
  38. set {m::%player%} to true
  39. loop {num} times:
  40. set {_xp} to x-coordinate of player
  41. set {_yp} to y-coordinate of player
  42. set {_zp} to z-coordinate of player
  43. set {_lop} to location of player
  44. wait 2 ticks
  45. set {_b} to single value "bloki.%loop-number%" get of "plugins/QGildie/schematy/%arg-2%.yml" parsed as material
  46. set {_lx} to single value "x.%loop-number%" get of "plugins/QGildie/schematy/%arg-2%.yml" parsed as number
  47. set {_ly} to single value "y.%loop-number%" get of "plugins/QGildie/schematy/%arg-2%.yml" parsed as number
  48. set {_lz} to single value "z.%loop-number%" get of "plugins/QGildie/schematy/%arg-2%.yml" parsed as number
  49. increase x-coordinate of {_lop} by {_lx}
  50. increase y-coordinate of {_lop} by {_ly}
  51. increase z-coordinate of {_lop} by {_lz}
  52. set block at {_lop} to {_b}
  53. show 10 "flame" particles at {_lop} for player offset by 0 , 0.2 , 0
  54. send "%{qg::opt::prefix}% &aWczytano schemat &e%arg-2%.yml%{qg::opt::suffix}%"
  55. delete {m::%player%}
  56.  
  57. on right click:
  58. if tool of player is blaze rod named "&eQ&6Admin":
  59. if clicked block is not air:
  60. set {qg::sel::loc1} to location of clicked block
  61. send "&aPozycja 1 ustawiona&8. &e%location of clicked block%"
  62.  
  63. on left click:
  64. if tool of player is blaze rod named "&eQ&6Admin":
  65. if clicked block is not air:
  66. set {qg::sel::loc2} to location of clicked block
  67. send "&aPozycja 2 ustawiona&8. &e%location of clicked block%"
  68. cancel event
  69.  
  70. on any move:
  71. if {m::%player%} is set:
  72. cancel event
Advertisement
Add Comment
Please, Sign In to add comment