Advertisement
Guest User

Untitled

a guest
Aug 27th, 2014
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.38 KB | None | 0 0
  1. #Skrypt stworzony specjalnie dla podania dla Skript.pl przez Xayanix
  2. Variables:
  3. {arenaWyscig} = false
  4. options:
  5. graczyDoStartu: 5
  6. maxGraczy: 10
  7. on script load:
  8. execute command "/scoreboard objectives add &aunRace dummy"
  9. execute command "/scoreboard objectives setdisplay belowName &aunRace"
  10. on script unload:
  11. execute command "/scoreboard objectives remove &aunRace"
  12. on load:
  13. set {arenaWyscig} to false
  14. clear {pozycja}
  15. loop {unRace::*}:
  16. clear {unRace::%loop-index%}
  17. #Zabezpieczenie przeciwko crashom serwera podczas trwania areny
  18. on join:
  19. if {unRacenick::%name of player%} is not set:
  20. set {unRacenick::%name of player%} to name of player
  21. if {unRaceranking::%name of player%} is not set:
  22. set {unRaceranking::%name of player%} to 100
  23. wait 1 tick
  24. execute command "/scoreboard players set %player% &aunRace %{unRaceranking::%name of player%}%"
  25. every 120 seconds: #Mysle ze taki czas starczy, nie ma co czesciej.
  26. loop all players:
  27. if {unRaceranking::%name of loop-player%} is set:
  28. execute command "/scoreboard players set %loop-player% &aunRace %{unRaceranking::%name of loop-player%}%"
  29. else:
  30. set {unRaceranking::%name of loop-player%} to 100
  31. execute command "/scoreboard players set %loop-player% &aunRace %{unRaceranking::%name of loop-player%}%"
  32. wait 1 tick #Zabezpieczenie przed spamem komend w konsoli
  33. command /wyscig [<text>] [<text>]:
  34. permission: wyscigCmd
  35. permission message: &1❱&9 &cNie posiadasz praw.
  36. aliases: unRace, ur
  37. trigger:
  38. if argument 1 is not set:
  39. send "&8[&a*&8]&m---------------------------------------&8[&a*&8]"
  40. send json "&1❱&9 /wyscig dolacz&7 - dolacza na arene" tooltip "&7Kliknij aby &9dolaczyc&7!" run "/wyscig dolacz" to player
  41. send json "&1❱&9 /wyscig opusc&7 - opuszcza arene" tooltip "&7Kliknij aby &9opuscic&7!" run "/wyscig opusc" to player
  42. send json "&1❱&9 /wyscig trofea&7 - wyswietla liste nagrod" tooltip "&7Kliknij aby poznac &9trofea&7!" run "/wyscig trofea" to player
  43. send json "&1❱&9 /wyscig ranking&7 - ranking wyscigow" tooltip "&7Kliknij aby poznac swoj &9ranking&7!" run "/wyscig ranking" to player
  44. send json "&1❱&9 /wyscig autor&7 - autor skryptu" tooltip "&7Kliknij aby poznac autora skryptu!" run "/wyscig autor" to player
  45. if player has permission "wyscig.admin":
  46. send "&c❱&9 /wyscig setspawn&7 - ustawia spawn (lobby areny)"
  47. send "&c❱&9 /wyscig setstart&7 - ustawia start areny"
  48. send "&a❱&7 Mozesz klikac na czat!"
  49. send "&8[&a*&8]&m---------------------------------------&8[&a*&8]"
  50. if argument 1 is "autor":
  51. send "&1❱&9 &aunRace 1.0%nl%&1❱&9&7 Wykonano przez &cXayanix&7 znanego rowniez jako &cUnixejPL&7."
  52. else if argument 1 is "setspawn":
  53. if player has permission "wyscig.admin":
  54. send "&c❱&a Ustawiles lobby areny."
  55. set {lobbyAreny} to player's location
  56. else:
  57. send "&1❱&9 &cNie posiadasz praw."
  58. else if argument 1 is "setstart":
  59. if player has permission "wyscig.admin":
  60. send "&c❱&a Ustawiles punkt startowy areny."
  61. set {startAreny} to player's location
  62. else:
  63. send "&1❱&9 &cNie posiadasz praw."
  64. else if argument 1 is "trofea":
  65. send "&1❱&7 Pierwsze miejsce: &6100 punktow."
  66. send "&1❱&7 Drugie miejsce: &650 punktow."
  67. send "&1❱&7 Trzecie miejsce: &625 punktow."
  68. else if argument 1 is "dolacz":
  69. if {unRaceOA.%name of player%} is true:
  70. send "&1❱&9 &cJestes juz na arenie."
  71. stop
  72. if {arenaWyscig} is true:
  73. send "&1❱&9 &cWyscig juz wystartowal!"
  74. stop
  75. if size of {unRace::*} is bigger than {@maxGraczy}:
  76. send "&1❱&9 &cArena pelna!"
  77. stop
  78. loop {unRace::*}:
  79. set {_x.%loop-value%} to loop-value
  80. if {_x.%name of player%} is not set:
  81. add name of player to {unRace::*}
  82. set {_y} to size of {unRace::*}
  83. send "&1❱&a Dolaczyles na arene (%{_y}%/{@maxGraczy})."
  84. set {unRaceOA.%name of player%} to true
  85. teleport player to {lobbyAreny}
  86. if {_y} is bigger or equal to {@graczyDoStartu}:
  87. broadcast "&1❱&7 Arena wyscig startuje za &a15 sekund&7."
  88. set {_wolne} to {@maxGraczy} - {_y}
  89. broadcast "&1❱&7 Wolne miejsca na arenie:&6 %{_wolne}%"
  90. wait 10 second
  91. set {_licznik} to 5
  92. loop 5 times:
  93. broadcast "&1❱&7 Pozostalo &6%{_licznik}% sekund&7 do startu areny wyscig."
  94. remove 1 from {_licznik}
  95. wait 1 second
  96. broadcast "&1❱&7 Arena wyscig wystartowala!"
  97. set {arenaWyscig} to true
  98. loop {unRace::*}:
  99. if loop-value parsed as player is online: #Zabezpieczenie przed wyjsciem z gry
  100. teleport loop-value parsed as player to {startAreny}
  101. else:
  102. remove loop-value from {unRace::*}
  103. clear {unRaceOA.%loop-value%}
  104. else if argument 1 is "opusc":
  105. if {unRaceOA.%name of player%} is true:
  106. send "&1❱&9 &aOpusciles arene."
  107. teleport player to spawn point #Teleport na spawn serwera po opuszczeniu areny. Mozna zmienic.
  108. delete {unRaceOA.%name of player%}
  109. remove name of player from {unRace::*}
  110. stop
  111. send "&1❱&c Nie jestes na arenie."
  112. else if argument 1 is "ranking":
  113. send "&1❱&7 &7Twoj ranking (punkty): &6%{unRaceranking::%name of player%}%"
  114. on entering of region "unRaceEnd":
  115. {arenaWyscig} is true
  116. {pozycja} is not set:
  117. set {pozycja} to 1
  118. if {unRaceOA.%name of player%}: #Zabezpieczenie przed wchodzeniem innym w mete
  119. if {pozycja} is 1:
  120. broadcast "&1❱&7 Gracz &6%player%&7 finiszuje jako pierwszy!"
  121. add 100 to {unRaceranking::%name of player%}
  122. remove name of player from {unRace::*}
  123. wait 1 second
  124. teleport player to {lobbyAreny}
  125. else if {pozycja} is 2:
  126. broadcast "&1❱&7 Gracz &6%player%&7 finiszuje jako drugi!"
  127. add 50 to {unRaceranking::%name of player%}
  128. remove name of player from {unRace::*}
  129. wait 1 second
  130. teleport player to {lobbyAreny}
  131. else if {pozycja} is 3:
  132. broadcast "&1❱&7 Gracz &6%player%&7 finiszuje jako trzeci!"
  133. add 25 to {unRaceranking::%name of player%}
  134. set {arenaWyscig} to false
  135. loop {unRace::*}:
  136. teleport loop-value parsed as player to {lobbyAreny}
  137. clear {unRace::%loop-index%}
  138. clear {unRaceOA.%loop-value%}
  139. clear {pozycja}
  140. broadcast "&1❱&7 Arena wyscig zakonczona."
  141. add 1 to {pozycja}
  142. every 1 second:
  143. if {arenaWyscig} isn't true:
  144. loop {unRace::*}:
  145. teleport loop-value parsed as player to {lobbyAreny}
  146. on leaving of region "unRaceArena":
  147. {unRaceOA.%name of player%} is true:
  148. cancel event
  149. send "&1❱&7 Uzyj /ur opusc."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement