Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Autor: Shooterowy
- options:
- poczatkowy_rozmiar: 20
- co_ile_powiekszac: 5
- maksymalny_rozmiar: 40
- Function tolowercase(string: string) :: string:
- replace all "A" with "a" in {_string}
- replace all "B" with "b" in {_string}
- replace all "C" with "c" in {_string}
- replace all "D" with "d" in {_string}
- replace all "E" with "e" in {_string}
- replace all "F" with "f" in {_string}
- replace all "G" with "g" in {_string}
- replace all "H" with "h" in {_string}
- replace all "I" with "i" in {_string}
- replace all "J" with "a" in {_string}
- replace all "K" with "k" in {_string}
- replace all "L" with "l" in {_string}
- replace all "M" with "m" in {_string}
- replace all "N" with "n" in {_string}
- replace all "O" with "o" in {_string}
- replace all "P" with "p" in {_string}
- replace all "Q" with "q" in {_string}
- replace all "R" with "r" in {_string}
- replace all "S" with "s" in {_string}
- replace all "T" with "t" in {_string}
- replace all "U" with "u" in {_string}
- replace all "V" with "v" in {_string}
- replace all "W" with "w" in {_string}
- replace all "X" with "x" in {_string}
- replace all "Y" with "y" in {_string}
- replace all "Z" with "z" in {_string}
- return {_string}
- on join:
- if {PrivateTerrain::dzialka::%player%} is not set:
- set {PrivateTerrain::dzialka::%player%} to player
- set {PrivateTerrain::dzialka::%player%::status} to false
- stop
- on place:
- # if Region.getAt{event-location} is set:
- # set {_dzialka} to "dzialka_%tolowercase(name of player)%"
- # if Region.getAt{event-location} is not {_dzialka}:
- # set {_owner} to Region.getAt{event-location}
- # replace "dzialka_" with "" in {_owner}
- # if {PrivateTerrain::dzialka::%{_owner}%::czlonkowie::*} contains name of player:
- # stop
- # send "&cTo jest dzialka innego gracza. Nie mozesz tutaj budowac."
- # cancel event
- # stop
- if player is holding gold block named "&aDzialka {@poczatkowy_rozmiar}x{@poczatkowy_rozmiar}" with lore "&3Postaw aby||&3utworzyc dzialke":
- if {PrivateTerrain::dzialka::%player%::status} is false:
- loop {PrivateTerrain::dzialka::*}:
- if distance between event-location and {PrivateTerrain::dzialka::%loop-index%::center} is smaller than or equal to {@maksymalny_rozmiar}*2:
- send "&cInny gracz ma juz dzialke w poblizu. Poszukaj innego miejsca."
- cancel event
- stop
- set {_dzialka} to "dzialka_%tolowercase(name of player)%"
- new region {_dzialka}
- {_dzialka}.Region.selectLS{event-location, {@poczatkowy_rozmiar}}
- set {PrivateTerrain::dzialka::%player%::status} to true
- set {PrivateTerrain::dzialka::%player%::center} to event-location
- set {PrivateTerrain::dzialka::%player%::size} to {@poczatkowy_rozmiar}
- send "&aStworzyles dzialke."
- stop
- else:
- cancel event
- send "&cMasz juz dzialke!"
- stop
- command /dzialka [<text>]:
- trigger:
- if arg is "kup":
- if player's money is more or equal to 5000:
- remove 5000 from player's money
- add gold block named "&aDzialka {@poczatkowy_rozmiar}x{@poczatkowy_rozmiar}" with lore "&3Postaw aby||&3utworzyc dzialke" to player
- send "&aKupiles dzialke!"
- stop
- else:
- send "&cNie masz tyle pieniedzy. Brakuje Ci $%5000-player's money%."
- if arg is "magazyn":
- wait 5 ticks
- open chest with 6 rows named "&6Magazyn" to player
- add {PrivateTerrain::dzialka::%player%::magazyn::*} to current inventory of player
- clear {PrivateTerrain::dzialka::%player%::magazyn::*}
- if arg is "powieksz":
- if ({PrivateTerrain::dzialka::%player%::size} + {@co_ile_powiekszac}) is less than or equal to {@maksymalny_rozmiar}:
- set {_dzialka} to "dzialka_%tolowercase(name of player)%"
- {_dzialka}.Region.delete{}
- new region {_dzialka}
- {_dzialka}.Region.selectLS{{PrivateTerrain::dzialka::%player%::center}, ({PrivateTerrain::dzialka::%player%::size} + {@co_ile_powiekszac})}
- add {@co_ile_powiekszac} to {PrivateTerrain::dzialka::%player%::size}
- send "&aPowiekszyles swoja dzialke o &c{@co_ile_powiekszac}&a."
- stop
- else:
- send "&cTwoja dzialka osiagnela maksymalny rozmiar!"
- if arg is "usun":
- wait 3 ticks
- open chest with 1 rows named "&1Potwierdz usuniecie" to player
- set {_d} to random number between 0 and 9
- loop 9 times:
- if loop-number - 1 is not {_d}:
- format slot loop-number - 1 of player with 1 of emerald block named "&aAnuluj" to close
- format slot {_d} of player with 1 of redstone block named "&cUsun dzialke" to close then run [execute player command "dzialka potwierdz"]
- if arg is "potwierdz":
- set {_dzialka} to "dzialka_%tolowercase(name of player)%"
- {_dzialka}.Region.delete{}
- set block at {PrivateTerrain::dzialka::%player%::center} to air
- set {PrivateTerrain::dzialka::%player%::status} to false
- clear {PrivateTerrain::dzialka::%player%::center}
- clear {PrivateTerrain::dzialka::%player%::size}
- clear {PrivateTerrain::dzialka::%player%::magazyn::*}
- clear {PrivateTerrain::dzialka::%player%::czlonkowie::*}
- send "&aUsunales dzialke!"
- stop
- if arg is "dodajgracza":
- if {PrivateTerrain::status::%player%} is "dodaj":
- clear {PrivateTerrain::status::%player%}
- send "&aZakonczono dodawanie graczy do dzialki."
- stop
- set {PrivateTerrain::status::%player%} to "dodaj"
- send "&aNapisz na czacie nick gracza ktorego chcesz dodac."
- send "&cUwaga: &7Gracz musi byc na serwerze!"
- send "&3Aby zakonczyc napisz na czacie &6""wyjdz"" &3lub powtornie nacisnij na przedmiot w menu dzialki."
- stop
- if arg is "usungracza":
- if {PrivateTerrain::status::%player%} is "usun":
- clear {PrivateTerrain::status::%player%}
- send "&aZakonczono usuwanie graczy z dzialki."
- stop
- set {PrivateTerrain::status::%player%} to "usun"
- send "&aNapisz na czacie nick gracza ktorego chcesz usunac."
- send "&3Aby zakonczyc napisz na czacie &6""wyjdz"" &3lub powtornie nacisnij na przedmiot w menu dzialki."
- stop
- on chat:
- if {PrivateTerrain::status::%player%} is "dodaj":
- cancel event
- if message is "wyjdz":
- clear {PrivateTerrain::status::%player%}
- send "&aZakonczono dodawanie graczy do dzialki."
- stop
- set {_p} to message parsed as player
- if {_p} is not set:
- send "&cNie ma takiego gracza!"
- stop
- if {_p} is player:
- send "&cNie mozesz dodac siebie do dzialki!"
- stop
- if {PrivateTerrain::dzialka::%player%::czlonkowie::*} contains {_p}:
- send "&cTen gracz nalezy juz do twojej dzialki!"
- stop
- send "&aDodano gracza &6%{_p}% &ado dzialki."
- add {_p} to {PrivateTerrain::dzialka::%player%::czlonkowie::*}
- send "&aGracz &6%player% &adodaj Cie do swojej dzialki." to {_p}
- stop
- if {PrivateTerrain::status::%player%} is "usun":
- cancel event
- if message is "wyjdz":
- clear {PrivateTerrain::status::%player%}
- send "&aZakonczono usuwanie graczy z dzialki."
- stop
- set {_p} to message
- if {_p} is player:
- send "&cNie mozesz usunac siebie z dzialki!"
- stop
- if {PrivateTerrain::dzialka::%player%::czlonkowie::*} contains {_p}:
- remove {_p} from {PrivateTerrain::dzialka::%player%::czlonkowie::*}
- send "&aUsunieto gracza &6%{_p}% &az dzialki."
- stop
- send "&cTen gracz nie nalezy do twojej dzialki!"
- stop
- on inventory close:
- if inventory name of current inventory of player is "&6Magazyn":
- add items in current inventory of player to {PrivateTerrain::dzialka::%player%::magazyn::*}
- on rightclick on gold block:
- if {PrivateTerrain::dzialka::%player%::status} is true:
- if event-location is {PrivateTerrain::dzialka::%player%::center}:
- wait 5 ticks
- open chest with 1 rows named "&6Menu dzialki" to player
- wait 5 ticks
- format slot 0 of player with 1 of chest named "&3Magazyn" to close then run [execute player command "dzialka magazyn"]
- format slot 1 of player with 1 of ladder named "&3Powieksz" to close then run [execute player command "dzialka powieksz"]
- format slot 2 of player with 1 of redstone block named "&3Usun" to close then run [execute player command "dzialka usun"]
- format slot 3 of player with 1 of nether star named "&3Dodaj gracza do dzialki" to close then run [execute player command "dzialka dodajgracza"]
- format slot 4 of player with 1 of 166 named "&3Usun gracza z dzialki" to close then run [execute player command "dzialka usungracza"]
- stop
- on break:
- if Region.getAt{event-location} is not "<none>":
- set {_dzialka} to "dzialka_%tolowercase(name of player)%"
- if Region.getAt{event-location} is not {_dzialka}:
- set {_owner} to Region.getAt{event-location}
- replace "dzialka_" with "" in {_owner}
- if {PrivateTerrain::dzialka::%{_owner}%::czlonkowie::*} contains name of player:
- if event-location is {PrivateTerrain::dzialka::%{_owner}%::center}:
- cancel event
- stop
- send "&cTo jest dzialka innego gracza. Nie mozesz tutaj niszczyc."
- cancel event
- stop
- if event-block is gold block:
- if {PrivateTerrain::dzialka::%player%::status} is true:
- if event-location is {PrivateTerrain::dzialka::%player%::center}:
- cancel event
- stop
- on rightclick:
- if Region.getAt{event-location} is not "<none>":
- set {_dzialka} to "dzialka_%tolowercase(name of player)%"
- if Region.getAt{event-location} is not {_dzialka}:
- set {_owner} to Region.getAt{event-location}
- replace "dzialka_" with "" in {_owner}
- if {PrivateTerrain::dzialka::%{_owner}%::czlonkowie::*} contains name of player:
- stop
- if clicked block is not air:
- cancel event
- send "&cTo jest dzialka innego gracza. Nie mozesz tutaj niczego zmieniac."
- stop
- on load:
- loop {PrivateTerrain::dzialka::*}:
- if {PrivateTerrain::dzialka::%loop-index%::status} is true:
- set {_dzialka} to "dzialka_%loop-index%"
- new region {_dzialka}
- {_dzialka}.Region.selectLS{{PrivateTerrain::dzialka::%loop-index%::center}, {PrivateTerrain::dzialka::%loop-index%::size}}
Add Comment
Please, Sign In to add comment