Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Skrypt stworzony specjalnie dla podania dla Skript.pl przez Xayanix
- Variables:
- {arenaWyscig} = false
- options:
- graczyDoStartu: 5
- maxGraczy: 10
- on script load:
- execute command "/scoreboard objectives add &aunRace dummy"
- execute command "/scoreboard objectives setdisplay belowName &aunRace"
- on script unload:
- execute command "/scoreboard objectives remove &aunRace"
- on load:
- set {arenaWyscig} to false
- clear {pozycja}
- loop {unRace::*}:
- clear {unRace::%loop-index%}
- #Zabezpieczenie przeciwko crashom serwera podczas trwania areny
- on join:
- if {unRacenick::%name of player%} is not set:
- set {unRacenick::%name of player%} to name of player
- if {unRaceranking::%name of player%} is not set:
- set {unRaceranking::%name of player%} to 100
- wait 1 tick
- execute command "/scoreboard players set %player% &aunRace %{unRaceranking::%name of player%}%"
- every 120 seconds: #Mysle ze taki czas starczy, nie ma co czesciej.
- loop all players:
- if {unRaceranking::%name of loop-player%} is set:
- execute command "/scoreboard players set %loop-player% &aunRace %{unRaceranking::%name of loop-player%}%"
- else:
- set {unRaceranking::%name of loop-player%} to 100
- execute command "/scoreboard players set %loop-player% &aunRace %{unRaceranking::%name of loop-player%}%"
- wait 1 tick #Zabezpieczenie przed spamem komend w konsoli
- command /wyscig [<text>] [<text>]:
- permission: wyscigCmd
- permission message: &1❱&9 &cNie posiadasz praw.
- aliases: unRace, ur
- trigger:
- if argument 1 is not set:
- send "&8[&a*&8]&m---------------------------------------&8[&a*&8]"
- send json "&1❱&9 /wyscig dolacz&7 - dolacza na arene" tooltip "&7Kliknij aby &9dolaczyc&7!" run "/wyscig dolacz" to player
- send json "&1❱&9 /wyscig opusc&7 - opuszcza arene" tooltip "&7Kliknij aby &9opuscic&7!" run "/wyscig opusc" to player
- send json "&1❱&9 /wyscig trofea&7 - wyswietla liste nagrod" tooltip "&7Kliknij aby poznac &9trofea&7!" run "/wyscig trofea" to player
- send json "&1❱&9 /wyscig ranking&7 - ranking wyscigow" tooltip "&7Kliknij aby poznac swoj &9ranking&7!" run "/wyscig ranking" to player
- send json "&1❱&9 /wyscig autor&7 - autor skryptu" tooltip "&7Kliknij aby poznac autora skryptu!" run "/wyscig autor" to player
- if player has permission "wyscig.admin":
- send "&c❱&9 /wyscig setspawn&7 - ustawia spawn (lobby areny)"
- send "&c❱&9 /wyscig setstart&7 - ustawia start areny"
- send "&a❱&7 Mozesz klikac na czat!"
- send "&8[&a*&8]&m---------------------------------------&8[&a*&8]"
- if argument 1 is "autor":
- send "&1❱&9 &aunRace 1.0%nl%&1❱&9&7 Wykonano przez &cXayanix&7 znanego rowniez jako &cUnixejPL&7."
- else if argument 1 is "setspawn":
- if player has permission "wyscig.admin":
- send "&c❱&a Ustawiles lobby areny."
- set {lobbyAreny} to player's location
- else:
- send "&1❱&9 &cNie posiadasz praw."
- else if argument 1 is "setstart":
- if player has permission "wyscig.admin":
- send "&c❱&a Ustawiles punkt startowy areny."
- set {startAreny} to player's location
- else:
- send "&1❱&9 &cNie posiadasz praw."
- else if argument 1 is "trofea":
- send "&1❱&7 Pierwsze miejsce: &6100 punktow."
- send "&1❱&7 Drugie miejsce: &650 punktow."
- send "&1❱&7 Trzecie miejsce: &625 punktow."
- else if argument 1 is "dolacz":
- if {unRaceOA.%name of player%} is true:
- send "&1❱&9 &cJestes juz na arenie."
- stop
- if {arenaWyscig} is true:
- send "&1❱&9 &cWyscig juz wystartowal!"
- stop
- if size of {unRace::*} is bigger than {@maxGraczy}:
- send "&1❱&9 &cArena pelna!"
- stop
- loop {unRace::*}:
- set {_x.%loop-value%} to loop-value
- if {_x.%name of player%} is not set:
- add name of player to {unRace::*}
- set {_y} to size of {unRace::*}
- send "&1❱&a Dolaczyles na arene (%{_y}%/{@maxGraczy})."
- set {unRaceOA.%name of player%} to true
- teleport player to {lobbyAreny}
- if {_y} is bigger or equal to {@graczyDoStartu}:
- broadcast "&1❱&7 Arena wyscig startuje za &a15 sekund&7."
- set {_wolne} to {@maxGraczy} - {_y}
- broadcast "&1❱&7 Wolne miejsca na arenie:&6 %{_wolne}%"
- wait 10 second
- set {_licznik} to 5
- loop 5 times:
- broadcast "&1❱&7 Pozostalo &6%{_licznik}% sekund&7 do startu areny wyscig."
- remove 1 from {_licznik}
- wait 1 second
- broadcast "&1❱&7 Arena wyscig wystartowala!"
- set {arenaWyscig} to true
- loop {unRace::*}:
- if loop-value parsed as player is online: #Zabezpieczenie przed wyjsciem z gry
- teleport loop-value parsed as player to {startAreny}
- else:
- remove loop-value from {unRace::*}
- clear {unRaceOA.%loop-value%}
- else if argument 1 is "opusc":
- if {unRaceOA.%name of player%} is true:
- send "&1❱&9 &aOpusciles arene."
- teleport player to spawn point #Teleport na spawn serwera po opuszczeniu areny. Mozna zmienic.
- delete {unRaceOA.%name of player%}
- remove name of player from {unRace::*}
- stop
- send "&1❱&c Nie jestes na arenie."
- else if argument 1 is "ranking":
- send "&1❱&7 &7Twoj ranking (punkty): &6%{unRaceranking::%name of player%}%"
- on entering of region "unRaceEnd":
- {arenaWyscig} is true
- {pozycja} is not set:
- set {pozycja} to 1
- if {unRaceOA.%name of player%}: #Zabezpieczenie przed wchodzeniem innym w mete
- if {pozycja} is 1:
- broadcast "&1❱&7 Gracz &6%player%&7 finiszuje jako pierwszy!"
- add 100 to {unRaceranking::%name of player%}
- remove name of player from {unRace::*}
- wait 1 second
- teleport player to {lobbyAreny}
- else if {pozycja} is 2:
- broadcast "&1❱&7 Gracz &6%player%&7 finiszuje jako drugi!"
- add 50 to {unRaceranking::%name of player%}
- remove name of player from {unRace::*}
- wait 1 second
- teleport player to {lobbyAreny}
- else if {pozycja} is 3:
- broadcast "&1❱&7 Gracz &6%player%&7 finiszuje jako trzeci!"
- add 25 to {unRaceranking::%name of player%}
- set {arenaWyscig} to false
- loop {unRace::*}:
- teleport loop-value parsed as player to {lobbyAreny}
- clear {unRace::%loop-index%}
- clear {unRaceOA.%loop-value%}
- clear {pozycja}
- broadcast "&1❱&7 Arena wyscig zakonczona."
- add 1 to {pozycja}
- every 1 second:
- if {arenaWyscig} isn't true:
- loop {unRace::*}:
- teleport loop-value parsed as player to {lobbyAreny}
- on leaving of region "unRaceArena":
- {unRaceOA.%name of player%} is true:
- cancel event
- send "&1❱&7 Uzyj /ur opusc."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement