Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
- # Stworzone przez: 4MaticPL #
- # Wersja: 1.2 #
- # #
- # Mozecie robic z tym skryptem #
- # co chcecie jednak prosze aby #
- # nie usuwac autora #
- # #
- #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
- on skript load:
- send "########################|SignShop|#########################" to console
- send "##Create by: 4MaticPL ##" to console
- send "##Version: 1.4 ##" to console
- send "##Skript create for version 2.0.2 ##" to console
- send "##Your skript version %skript-version% ##" to console
- send "######################################################################" to console
- #===============================================================================================================
- #=============================================#OPCJE#===========================================================
- options:
- sk: &f[&3SignShop&f] #nazwa skryptu
- chestset: true #automatyczne stawianie skrzyni po ustawieniu tabliczki
- #true - skrzynka sie pojawi
- #false - trzeba bedzie samemu postawic skrzynke
- tntexplosion: true #Blokuje wybuch tnt w okolicjach sklepu
- #true - tnt wybucha normalnie
- #false - tnt wybucha ale nie niszczy sklepu i blokow w promieniu 5 kratek
- noperm: &4Nie masz do tego prawa!
- perm.create: skript.signshop.create
- perm.admin: skript.signshop.admin
- sign.material.error: &4Niepoprawne id itemu
- shop.create: &6Sklep zostal pomyslnie utworzony!
- shop.nochest: &4Najpierw postaw skrzynie!
- shop.empty: &6Sklep jest pusty!
- shop.line2.empty: &4W lini 2 wpisz Kup(K) lub Sprzedaj(S)
- shop.line3.empty: &4W lini 3 wpisz ID itemu
- shop.line4.empty: &4W lini 4 wpisz cene za 1 sztuke
- shop.chest.open.other: &4To nie jest twoj sklep!
- shop.chest.more: &6Sklep moze skladac sie tylko z jednej skrzyni
- shop.chest.hopper: &6Nie mozesz stawiac hopperow obok sklepu
- shop.destroy.sign: &6Sklep zostal zniszczony
- shop.destroy.other: &4To nie jest twoj sklep!
- shop.destroy.chest: &6Najpierw zniszcz tabliczke
- shop.destroy.block: &6Ten blok jest za blisko sklepu!
- shop.empty: &6Sklep jest pusty!
- player.money.error: &6Masz za malo pieniedzy!
- player.money.pay: &6Zaplaciles w sumie &2%{money.pay.%player%}% CC
- player.money.take: &6Zarobiles w sumie &2%{money.take.%player%}% CC
- player.empty: &4Nie masz itemow do sprzedania!
- #===============================================================================================================
- #==================================#SPRAWDZENIE RODZAJU SKLEPU#=================================================
- on sign change:
- 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 "{@sk}{@noperm}"
- set event-block to air
- drop sign
- stop
- else if line 1 is "[Sklep Admin]" or "[SA]" or "[sa]" or "[SklepAdmin]": #====> warunek dla tworzenia: Sklep Admin
- player has permission "{@perm.admin}":
- set line 1 to "&4[Sklep Admin]"
- set {_chest.check} to false
- else:
- message "{@sk}{@noperm}"
- 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:
- message "{@sk}{@shop.line2.empty}"
- set event-block to air
- drop sign
- stop
- line 3 is empty:
- message "{@sk}{@shop.line3.empty}"
- set event-block to air
- drop sign
- stop
- line 4 is empty:
- message "{@sk}{@shop.line4.empty}"
- set event-block to air
- drop sign
- stop
- player has permission "{@perm.create}":
- if line 2 is "k" or "K" or "Kup" or "kup" or "KUP" or "Buy" or "BUY" or "B" or "b":
- set line 2 to "Kup"
- else if line 2 is "s" or "S" or "Sprzedaj" or "SPRZEDAJ" or "sprzedaj" or "Sell" or "sell":
- set line 2 to "Sprzedaj"
- else:
- message "{@sk}{@shop.line2.empty}"
- 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
- message "{@sk}{@shop.create}"
- 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
- message "{@sk}{@shop.create}"
- set {shop.list::%location of block%} to "%name of player%"
- stop
- #===============================================================================================================
- #============================================#USUWANIE SKLEPU#==================================================
- on break of sign:
- {shop.list::%location of block%} is set:
- if player has permission "shop.admin":
- delete {shop.list::%location of block%}
- message "{@sk}{@shop.destroy.sign}"
- 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 "{@sk}{@shop.destroy.sign}"
- else:
- message "{@sk}{@shop.destroy.other}"
- cancel event
- on break:
- loop blocks in radius 1 of event-block:
- if {shop.list::%location of loop-block%} is set:
- if y-coord of loop-block is greater than or equal to y-coord of event-block:
- if event-block is chest:
- message "{@sk}{@shop.destroy.chest}"
- else:
- message "{@sk}{@shop.destroy.block}"
- set event-block to air
- cancel event
- stop trigger
- #====================================#DODATKOWE ZABEZPIECZENIA#===============================================
- on explosion:
- if {@tntexplosion} is false:
- loop blocks in radius 5 of event-location:
- loop-block is chest:
- {shop.list::%location of block above loop-block%} is set:
- message "{@sk}{@shop.chest.more}"
- broadcast "test"
- cancel event
- stop
- else:
- loop blocks in radius 5 of event-location:
- loop-block is chest:
- {shop.list::%location of block above loop-block%} is set:
- clear {shop.list::%location of block above loop-block%}
- send "debug"
- stop
- on place of chest:
- loop blocks in radius 1 around event-block:
- loop-block is chest
- y-coord of loop-block is y-coord of event-block
- {shop.list::%location of block above loop-block%} is set
- message "{@sk}{@shop.chest.more}"
- cancel event
- stop
- on place of hopper:
- loop blocks in radius 1 around event-block:
- {shop.list::%location of block above loop-block%} is set
- message "{@sk}{@shop.chest.hopper}"
- cancel event
- stop
- #==============================================================================================================
- #===================================#BLOKADA DOSTĘPU DO CZYJEGOŚ SKLEPU#=======================================
- on rightclick on chest:
- {shop.list::%location of block above event-block%} is set
- if {shop.list::%location of block above event-block%} is "%name of player%":
- stop
- else:
- if player has permission "{@perm.admin}":
- send "{@sk}&6Drogi Adminie %name of player% wlasnie otwierasz kogos sklep :D"
- stop
- message "{@sk}{@shop.chest.open.other}"
- cancel event
- #==============================================================================================================
- #============================#OBSLUGA KUPNA I SPRZEDARZY SKLEP I SKLEP ADMIN#==================================
- on rightclick on sign:
- if line 1 is "&4[Sklep Admin]" or "&2[Sklep]":
- if line 1 is "&4[Sklep Admin]":
- set {_chest.check} to false
- else if line 1 is "&2[Sklep]":
- set {_chest.check} to true
- else:
- stop
- if line 2 is "Kup":
- wait 5 tick
- set {_item} to line 3 parsed as itemtype
- set {_int} to line 4 parsed as integer
- set {_owner} to {shop.list::%location of block%} parsed as player
- if {_chest.check} is true:
- if block below event-block contain {_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 {_item} from block below event-block
- give {_item} to the player
- add {_int} to {money.pay.%player%}
- stop
- else:
- message "{@sk}{@player.money.error}"
- stop
- else:
- message "{@sk}{@shop.empty}"
- stop
- else:
- if player's balance is greater than or equal to {_int}:
- remove {_int} from player's balance
- give {_item} to the player
- add {_int} to {money.pay.%player%}
- stop
- else:
- message "{@sk}{@player.money.error}"
- stop
- if line 2 is "Sprzedaj":
- wait 5 tick
- set {_item} to line 3 parsed as itemtype
- set {_int} to line 4 parsed as integer
- set {_owner} to {shop.list::%location of block%} parsed as player
- if {_chest.check} is true:
- if player has {_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 {_item} to block below event-block
- remove {_item} from the player's inventory
- add {_int} to {money.take.%player%}
- stop
- else:
- message "{@sk}{@player.money.error}"
- stop
- else:
- message "{@sk}{@player.empty}"
- stop
- else:
- if player has {_item}:
- add {_int} to player's balance
- remove {_item} from the player's inventory
- add {_int} to {money.take.%player%}
- stop
- else:
- message "{@sk}{@player.empty}"
- stop
- on walk on gravel:
- if {money.take.%player%} is set:
- message "{@sk}{@player.money.take}"
- delete {money.take.%player%}
- if {money.pay.%player%} is set:
- message "{@sk}{@player.money.pay}"
- delete {money.pay.%player%}
- stop
Advertisement
Add Comment
Please, Sign In to add comment