Slupik98

Drop ze stone

Aug 21st, 2014
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.35 KB | None | 0 0
  1. Options:
  2. logo: &8[&aSkyBlock&8]
  3. #=================================================================================================
  4. command /SkyDrop [<text>] [<text>]:
  5. trigger:
  6. if arg 1 is "ref" or "refresh":
  7. if sender is player:
  8. if player do not have permissions "SkyDrop.refresh":
  9. stop
  10. delete {SkyDrop::config::*}
  11. delete {SkyDrop::bloki::lista::*}
  12. if folder "plugins/Skript/scripts/SkyDrop/config.yml" doesn't exists:
  13. create folder "plugins/Skript/scripts/SkyDrop/config.yml"
  14. create file "plugins/Skript/scripts/SkyDrop/config.yml"
  15. wf "Drop:" "plugins/Skript/scripts/SkyDrop/config.yml"
  16. wf " diamond: " "plugins/Skript/scripts/SkyDrop/config.yml"
  17. wf " blocks: " "plugins/Skript/scripts/SkyDrop/config.yml"
  18. wf " gold:" "plugins/Skript/scripts/SkyDrop/config.yml"
  19. wf " chance: 50" "plugins/Skript/scripts/SkyDrop/config.yml"
  20. wf " drop: 'golde ore'" "plugins/Skript/scripts/SkyDrop/config.yml"
  21. else:
  22. if file "plugins/Skript/scripts/SkyDrop/config.yml" doesn't exists:
  23. create file "plugins/Skript/scripts/SkyDrop/config.yml"
  24. wf "Drop:" "plugins/Skript/scripts/SkyDrop/config.yml"
  25. wf " diamond: " "plugins/Skript/scripts/SkyDrop/config.yml"
  26. wf " blocks: " "plugins/Skript/scripts/SkyDrop/config.yml"
  27. wf " gold:" "plugins/Skript/scripts/SkyDrop/config.yml"
  28. wf " chance: 50" "plugins/Skript/scripts/SkyDrop/config.yml"
  29. wf " drop: 'golde ore'" "plugins/Skript/scripts/SkyDrop/config.yml"
  30. else:
  31. set {_bloki::*} to configuration section "Drop" get of "plugins/Skript/scripts/SkyDrop/config.yml"
  32. loop {_bloki::*}:
  33. set {_blok} to loop-value
  34. set {_blok} to {_blok} parsed as item type
  35. if {_blok} is set:
  36. if "%{_blok}%" is "diament" or "diamond" or "diax":
  37. set {SkyDrop::config::klockiNaDiaxa} to single value "Drop.diamond.blocks" get of "plugins/Skript/scripts/SkyDrop/config.yml" parsed as number
  38. if {SkyDrop::config::klockiNaDiaxa} is not set:
  39. send "{@logo} &bDiament &anie ma podanej poprawnej liczby klocków do wykopania"
  40. else:
  41. set {SkyDrop::config::szansa::%{_blok}%} to single value "Drop.%{_blok}%.chance" get of "plugins/Skript/scripts/SkyDrop/config.yml" parsed as number
  42. if {SkyDrop::config::szansa::%{_blok}%} is not set:
  43. send "{@logo} &aBlok &8%loop-value% &anie ma podanej szansy"
  44. else:
  45. set {SkyDrop::config::drop::%{_blok}%} to single value "Drop.%{_blok}%.drop" get of "plugins/Skript/scripts/SkyDrop/config.yml" parsed as item type
  46. if {SkyDrop::config::drop::%{_blok}%} is not set:
  47. send "{@logo} &aBlok &8%loop-value% &anie ma podanego dropu"
  48. else:
  49. add loop-value to {SkyDrop::bloki::lista::*}
  50. else:
  51. send "{@logo} &aBlok &8%loop-value% &ajest niepoprawny"
  52. send "{@logo} &aOdświeżono skrypt SkyDrop"
  53. stop
  54. if arg 1 is "r" or "reload":
  55. if sender is player:
  56. if player do not have permissions "SkyDrop.refresh":
  57. stop
  58. run player command "skript reload %script%" as op
  59. #
  60. on load:
  61. execute console command "SkyDrop ref"
  62. #
  63. on break:
  64. if block at location of event-block is stone or cobblestone:
  65. set {_loc} to location of event-block
  66. #cancel event
  67. #set block at {_loc} to air
  68. add 1 to {SkyDrop::gracz::%player%::naDiaxa}
  69. add 1 to {Statystyki::gracz::%player%::stoneCobblestone}
  70. set {Statystyki::gracze::stoneCobblestone::%player%} to {Statystyki::gracz::%player%::stoneCobblestone}
  71. if {SkyDrop::gracz::%player%::naDiaxa} is greater than {SkyDrop::config::klockiNaDiaxa}:
  72. cancel event
  73. set block at {_loc} to air
  74. drop diamond ore at {_loc}
  75. set {SkyDrop::gracz::%player%::naDiaxa} to 0
  76. add 1 to {Statystyki::gracz::%player%::diamenty}
  77. set {Statystyki::gracze::diamenty::%player%} to {Statystyki::gracz::%player%::diamenty}
  78. stop
  79. else:
  80. loop {SkyDrop::bloki::lista::*}:
  81. set {_blok} to loop-value
  82. chance of {SkyDrop::config::szansa::%{_blok}%}%:
  83. cancel event
  84. set block at {_loc} to air
  85. drop {SkyDrop::config::drop::%{_blok}%} at {_loc}
  86. exit loop
  87. #
  88. command /sprawdz:
  89. aliases: stone, cobblestone
  90. trigger:
  91. set {_poz} to {SkyDrop::config::klockiNaDiaxa}-{SkyDrop::gracz::%player%::naDiaxa}
  92. send "{@logo} &aDo wykopania pozostalo ci jeszcze &8%{_poz}% &acobblestone/stone aby dostać &bDiament&a!"
Advertisement
Add Comment
Please, Sign In to add comment