Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
- # Stworzone przez: 4MaticPL #
- # Wersja: 2.3 #
- # #
- # Mozecie robic z tym skryptem #
- # co chcecie jednak prosze aby #
- # nie usuwac autora #
- # #
- #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
- #===================================================================================================================#
- #=============================================#OPCJE#===============================================================#
- #===================================================================================================================#
- options:
- version: 2.3
- max_buy: 5000 #Maksymalna cena kupna
- max_sell: 5000 #Maksymalna cena sprzedarzy
- chestset: true #automatyczne stawianie skrzyni po ustawieniu tabliczki
- #true - skrzynka sie pojawi
- #false - trzeba bedzie samemu postawic skrzynke
- tntexplosion: false #Blokuje wybuch tnt w okolicjach sklepu
- #true - tnt wybucha normalnie
- #false - tnt wybucha ale nie niszczy sklepu i blokow w promieniu 5 kratek
- worldallow: false #Pozwala na tworzenie sklepow tylko na danym swiecie
- #true- tylko wybrany swiat
- #false - sklepy dostepne na wszystkich swiatach
- world: SPAWN #Tutaj podajesz nazwe swiata,na ktorym maja dzialac sklepy
- #musisz tutaj podac nazwe swiata, ktora jest juz na serwerze
- #w innym przypadku wyskoczy blad
- morechest: false #Umozliwia to tworzenie sklepow z podwojnych skrzyn
- #true - sklep moze skladac sie z podwojnej skrzyni
- #false - sklep moze byc stworzony tylko z 1 skrzyni
- hopperpick: false #Umozliwia zabieranie itemow ze skrzyni sklepowej przez hopper
- #true - mozna krasc itemy
- #false - kradzierz jest zablokowana
- creativecontrol: true #Blokada kupowania w trybie creative
- #true - nie mozna kupowac w trybie creative
- #false - mozna kupowac w trybie creative
- addons: true #Obsluga dodatkow (w budowie)
- #true - dodatki sa obslugiwane
- #false - dodatki sa wylaczone
- #-----------------Uprawnienia-------------------------------#
- perm.create: skript.signshop.create #Uprawnienie do tworzenia Sklep
- perm.admin: skript.signshop.create.* #Uprawnienie do tworzenia SklepAdmin
- #-#-#-#-#-#-#-#-#-#-#-#-#-#
- # #
- # Koniec konfiguracji #
- # #
- # Jezeli nie znasz sie #
- # na skryptach lepiej #
- # nie tykaj kodu ponizej #
- # :) #
- #-#-#-#-#-#-#-#-#-#-#-#-#-#
- on skript load:
- send "########################|SignShop|#########################" to console
- send "##Create by: 4MaticPL ##" to console
- send "##Version: {@version} ##" to console
- send "##Skript create for version 2.0.2 ##" to console
- send "##Your skript version %skript-version% ##" to console
- send "######################################################################" to console
- #===================================================================================================================#
- #==================================#SPRAWDZENIE RODZAJU SKLEPU#=====================================================#
- #===================================================================================================================#
- on sign change:
- if line 1 is "[Sklep Admin]" or "[SA]" or "[sa]" or "[SklepAdmin]" or "[Sklep]":
- if {@worldallow} is true:
- if player is not in world "{@world}":
- send "&f[&9SignShop&f] &cW tym swiecie nie mozna robic sklepu"
- set event-block to air
- drop sign
- stop
- if line 1 is "[Sklep]": #====> warunek dla tworzenia: Sklep
- player has permission "{@perm.create}":
- set line 1 to "&2[Sklep]"
- set {_chest.check} to true
- else:
- message "&f[&9SignShop&f] &4Nie masz do tego prawa!"
- set event-block to air
- drop sign
- stop
- else if line 1 is "[Sklep Admin]" or "[SA]" or "[sa]" or "[SklepAdmin]" or "&4[Sklep Admin]": #====> warunek dla tworzenia: Sklep Admin
- player has permission "{@perm.admin}":
- set line 1 to "&4[Sklep Admin]"
- set {_chest.check} to false
- else:
- message "&f[&9SignShop&f] &4Nie masz do tego prawa!"
- set event-block to air
- drop sign
- stop
- #===================================================================================================================#
- #===================================#SPRAWDZENIE RESZTY ARGUMENTOW#=================================================#
- #===================================================================================================================#
- if line 1 is "&4[Sklep Admin]" or "&2[Sklep]":
- line 2 is empty:
- send "&f[&9SignShop&f] &4Podaj ilosc itemu"
- set event-block to air
- drop sign
- stop
- line 3 is empty:
- send "&f[&9SignShop&f] &4W lini 3 wpisz ID itemu"
- set event-block to air
- drop sign
- stop
- line 4 is empty:
- send "&f[&9SignShop&f] &4W lini 4 wpisz cene za 1 sztuke"
- set event-block to air
- drop sign
- stop
- #===================================================================================================================#
- #=========================================#SPRAWDZENIE CZY JEST SKRZYNKA============================================#
- #===================================================================================================================#
- if {_chest.check} is true:
- if block below event-block is chest: #====> warunek jeśli skrzynka jest
- send "&f[&9SignShop&f] &6Sklep zostal pomyslnie utworzony!"
- set {shop.list::%location of block%} to "%name of player%"
- else:
- if {@chestset} is true:
- set block below event-block to chest #====> warunek jeśli nie ma skrzynki
- set {shop.list::%location of block%} to "%name of player%"
- send "&f[&9SignShop&f] &6Sklep zostal pomyslnie utworzony!"
- stop
- if {_chest.check} is false:
- send "&f[&9SignShop&f] &6Sklep zostal pomyslnie utworzony!"
- stop
- #===================================================================================================================#
- #============================================#USUWANIE SKLEPU#======================================================#
- #===================================================================================================================#
- on break of sign:
- {shop.list::%location of block%} is set:
- if player has permission "{@perm.admin}":
- delete {shop.list::%location of block%}
- message "&f[&9SignShop&f] &6Sklep zostal zniszczony"
- wait 1 tick
- set event-block to air
- else if "%name of player%" is "%{shop.list::%location of block%}%":
- delete {shop.list::%location of block%}
- message "&f[&9SignShop&f] &6Sklep zostal zniszczony"
- else:
- message "&f[&9SignShop&f] &4To nie jest twoj sklep!"
- cancel event
- stop
- on break:
- loop blocks in radius 1 of event-block:
- if {shop.list::%location of loop-block%} is set:
- if block behind event-block is loop-block:
- message "&f[&9SignShop&f] &6Najpierw zniszcz tabliczke"
- cancel event
- if block below loop-block is chest:
- message "&f[&9SignShop&f] &6Najpierw zniszcz tabliczke"
- cancel event
- stop
- #===================================================================================================================#
- #====================================#DODATKOWE ZABEZPIECZENIA#=====================================================#
- #===================================================================================================================#
- on explosion:
- loop blocks in radius 5 of event-location:
- loop-block is chest:
- {shop.list::%location of block above loop-block%} is set:
- if {@tntexplosion} is true:
- message "&f[&9SignShop&f] &6Sklep moze skladac sie tylko z jednej skrzyni"
- cancel event
- stop
- else:
- clear {shop.list::%location of block above loop-block%}
- stop
- on place of chest:
- loop blocks in radius 2 around event-block:
- if loop-block is chest:
- if y-coord of loop-block is y-coord of event-block:
- if {shop.list::%location of block above loop-block%} is set:
- if block above loop-block is chest:
- if {@morechest} is false:
- message "&f[&9SignShop&f] &6Sklep moze skladac sie tylko z jednej skrzyni"
- cancel event
- stop
- on place:
- if {shop.list::%block behind event-block%} is set:
- cancel event
- on place of hopper:
- loop blocks in radius 1 around event-block:
- if {shop.list::%location of block above loop-block%} is set:
- if {@hopperpick} is false:
- message "&f[&9SignShop&f] &6Nie mozesz stawiac hopperow obok sklepu"
- cancel event
- stop
- #===================================================================================================================#
- #===================================#BLOKADA DOSTĘPU DO CZYJEGOŚ SKLEPU#============================================#
- #===================================================================================================================#
- on rightclick on chest:
- if {shop.list::%location of block above event-block%} is set:
- if {shop.list::%location of block above event-block%} is not "%name of player%":
- if player has permission "{@perm.admin}":
- stop
- else:
- message "&f[&9SignShop&f] &4To nie jest twoj sklep!"
- cancel event
- stop
- #==================================================================================================================#
- #============================#OBSLUGA KUPNA I SPRZEDARZY SKLEP I SKLEP ADMIN#======================================#
- #==================================================================================================================#
- on rightclick on sign:
- if line 1 is "&4[Sklep Admin]" or "&2[Sklep]":
- if player's gamemode is creative:
- if player is not op:
- if {@creativecontrol} is true:
- send "&f[&9SignShop&f] &cZmien tryb gry na survival!"
- stop
- if line 1 is "&4[Sklep Admin]":
- set {_chest.check} to false
- else if line 1 is "&2[Sklep]":
- set {_chest.check} to true
- if block below event-block is not chest:
- message "&f[&9SignShop&f] &4Sklep nie posiada skrzyni!"
- stop
- else:
- stop
- wait 5 tick
- line 3 of clicked block contains "K":
- loop {@max_buy} times:
- line 3 of clicked block contains "K %loop-number%:":
- set {_int} to loop-number
- set {_amount} to line 2 parsed as integer
- set {_item} to line 4 parsed as itemtype
- set {_owner} to {shop.list::%location of block%} parsed as player
- if {_chest.check} is true:
- if block below event-block contain {_amount} of {_item}:
- if player's balance is greater than or equal to {_int}:
- if {_chest.check} is true:
- add {_int} to {_owner}'s balance
- remove {_int} from player's balance
- remove {_amount} of {_item} from block below event-block
- give {_amount} of {_item} to the player
- stop
- else:
- message "&f[&9SignShop&f] &6Masz za malo pieniedzy!"
- stop
- else:
- message "&f[&9SignShop&f] &6Sklep jest pusty!"
- stop
- else:
- if player's balance is greater than or equal to {_int}:
- remove {_int} from player's balance
- give {_item} to the player
- stop
- else:
- message "&f[&9SignShop&f] &6Masz za malo pieniedzy!"
- stop
- on leftclick on sign:
- if line 1 is "&4[Sklep Admin]" or "&2[Sklep]":
- if player's gamemode is creative:
- if player is not op:
- if {@creativecontrol} is true:
- send "&f[&9SignShop&f] &cZmien tryb gry na survival!"
- stop
- if line 1 is "&4[Sklep Admin]":
- set {_chest.check} to false
- else if line 1 is "&2[Sklep]":
- set {_chest.check} to true
- if block below event-block is not chest:
- message "&f[&9SignShop&f] &4Sklep nie posiada skrzyni!"
- stop
- else:
- stop
- wait 5 tick
- line 3 of clicked block contains "S":
- loop {@max_sell} times:
- line 3 of clicked block contains ":%loop-number% S":
- set {_int} to loop-number
- set {_amount} to line 2 parsed as integer
- set {_item} to line 4 parsed as itemtype
- set {_owner} to {shop.list::%location of block%} parsed as player
- if {_chest.check} is true:
- if player has {_amount} of {_item}:
- if {_owner}'s balance is greater than or equal to {_int}:
- if {_chest.check} is true:
- remove {_int} from {_owner}'s balance
- add {_int} to player's balance
- add {_amount} of {_item} to block below event-block
- remove {_amount} of {_item} from the player's inventory
- stop
- else:
- message "&f[&9SignShop&f] &6Wlasciciel sklepu nie ma juz pieniedzy!"
- stop
- else:
- message "&f[&9SignShop&f] &4Nie masz wystarczajaco itemow do sprzedania!"
- stop
- else:
- if player has {_item}:
- add {_int} to player's balance
- remove {_item} from the player's inventory
- stop
- else:
- message "&f[&9SignShop&f] &4Nie masz itemow do sprzedania!"
- stop
Advertisement
Add Comment
Please, Sign In to add comment