Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- tag: &eSklep »
- cena: 50 #Jesli zmieniasz tu
- startoweLinijki: 2
- cenaV: 40
- maxLinijek: 5
- waluta: gold ingot
- vipPerm: jestem.vipem
- promien: 15
- variables:
- {handel:%player%:open} = false
- {handel:%player%:ilocs} = 2
- {handel:%player%:cena} = 50 #Zmien i tu na to samo co tam
- function potwierdzZakup(n: integer, koszt: integer, seller: player, buyer: player):
- set {_nbr} to {_n}
- if {_nbr} is set:
- set {_amount} to number of {@waluta} in {_buyer}'s inventory
- if {_amount} is greater or equal to {_koszt}:
- give {_koszt} of {@waluta} to {_seller}
- give {_przedmiot} to {_buyer}
- set {handel:%{_seller}%:itemlist::%{_nbr}%} to none
- set {handel:%{_seller}%:itemprices::%{_nbr}%} to none
- remove {_koszt} of {@waluta} from {_buyer}
- send "&aSprzedano Przedmiot!" to {_seller}
- send "&aZakonczono transakcje!" to {_buyer}
- launch flickering trailing ball firework colored green at {_seller} timed 1
- else:
- send "{@tag} &cNie masz tyle zlota!" to {_buyer}
- function modal(n: integer, koszt: integer, seller: player, buyer: player):
- open chest with 4 rows named "&9Potwierdz" to {_buyer}
- wait 2 tick
- format slot 11 of {_buyer} with red stained glass named "&4Anuluj" to close
- set {_a} to {_n}
- set {_b} to {_koszt}
- set {_c} to {_seller}
- set {_d} to {_buyer}
- format slot 15 of {_buyer} with green stained glass named "&aKUP" to run [potwierdzZakup({_a}, {_b}, {_c}, {_d})]
- format slot 4 of {_buyer} with {@waluta} named "&6Waluta" to be unstealable
- set {_item} to {handel:%{_seller}%:itemlist::%{_n}%}
- format slot 22 of {_buyer} with {_item} with lore "&cCena: %{_koszt}%" to be unstealable
- function usunPrzedmiot(n: integer, gracz: player):
- give {handel:%{_gracz}%:itemlist::%{_n}%} to {_gracz}
- set {handel:%{_gracz}%:itemlist::%{_n}%} to none
- set {handel:%{_gracz}%:itemprices::%{_n}%} to none
- send "{@tag} &cUsunales przedmiot." to {_gracz}
- function powiekszSklep(gracz: player):
- set {_amount} to number of {@waluta} in {_gracz}'s inventory
- if {_gracz} has permission "{@vipPerm}":
- set {_c} to {@cenaV}
- else:
- set {_c} to {@cena}
- set {_x} to {_c} * {@startoweLinijki}
- set {_l} to {handel::%{_gracz}%::iloscLinii} + 1
- set {_cen} to {_l} * {_c}
- set {_cena} to {_cen} - {_x}
- if {_amount} is greater or equal to {_cena}:
- if {handel::%{_gracz}%::iloscLinii} is less than {@maxLinijek}:
- add 1 to {handel::%{_gracz}%::iloscLinii}
- remove {_cena} of {@waluta} from {_gracz}
- send "{@tag} &aDokupiles dodatkowa linijke do sklepu. Aktualnie masz %{handel::%{_gracz}%::iloscLinii}% linijek!" to {_gracz}
- close {_gracz}'s inventory
- else:
- send "{@tag} &cPosiadasz maksymalna ilosc linijek w sklepie." to {_gracz}
- else:
- send "{@tag} &cNie posiadasz tyle zlota!" to {_gracz}
- command /sklep [<text="pomoc">] [<text>] [<text>] [<text>]:
- trigger:
- if arg 1 is "pomoc":
- send "{@tag}"
- send "&7/sklep pomoc &6- Pomoc"
- send "&7/sklep zaloz <Nazwa Sklepu> &6- Dodaje Sklep"
- send "&7/sklep usun &6- Usuwa Sklep"
- send "&7/sklep ditem <Cena Przedmiotu> &6- Dodaje item do sklepu"
- send "&7/sklep uitem &6- Usuwanie Przedmiotow"
- send "&7/sklep otworz &6- Otwiera Sklep"
- send "&7/sklep zamknij &6- Zamyka Sklep"
- send "&7/sklep podglad &6- Podglad Sklepu"
- send "&7/sklep powieksz &6- Powiekszenie Sklepu za zloto"
- send "{@tag}"
- if arg 1 is "zaloz":
- if distance between {handel::miejsce} and location of player is less than {@promien}:
- if {handel:%player%:open} is true:
- send "{@tag} &cPosiadasz juz sklep"
- stop
- if {handel:%player%:open} is false:
- set {handel:%player%:open} to true
- set {handel:%player%:otwarty} to false
- send "{@tag} &aUtworzyles sklep!"
- send "{@tag} &7Nie jest on jeszcze otwarty, aby go otworzyć wpisz: "
- send "{@tag} &6/sklep otworz"
- apply Slowness 99 to the player for 999 days
- set {_y} to player's y-coordinate + 1.25
- set {_loc} to location at player's x-coordinate, {_y}, player's z-coordinate of the world world of player
- new Hologram "%player's name%";
- if player has permission "{@vipPerm}":
- "%player's name%".Hologram.change{"&6Sklep gracza %name of player% (zamkniety)"};
- else:
- "%player's name%".Hologram.change{"&eSklep gracza %name of player% (zamkniety)"};
- "%player's name%".Hologram.show{{_loc}};
- stop
- else:
- send "{@tag} &cNie jestes w miejscu, w ktorym mozna zakladac sklep! &4(%{handel::miejsce}%)"
- stop
- if arg 1 is "usun":
- if {handel:%player%:open} is false:
- send "{@tag} &cNie posiadasz sklepu"
- stop
- if {handel:%player%:open} is true:
- set {handel:%player%:open} to false
- loop {handel:%player%:itemlist::*}:
- give loop-value to player
- clear {handel:%player%:itemlist::*}
- clear {handel:%player%:itemprices::*}
- set {handel:%player%:otwarty} to false
- send "{@tag} &cUsuneles sklep!"
- clear {sklep:%player%:nazwa}
- remove slowness from player
- "%player's name%".Hologram.delete{};
- stop
- if arg 1 is "ditem":
- if arg 2 is not set:
- send "{@tag} &cPoprawne uzycie! &4/sklep ditem <cena>"
- if arg 2 is set:
- if player's tool is air:
- send "{@tag} &cNie masz nic w rece!" to player
- stop
- if player's tool is {@waluta}:
- send "{@tag} &cNie mozesz sprzedac waluty!"
- stop
- if {handel:%player%:open} is false:
- send "{@tag} &cNie posiadasz Sklepu!"
- stop
- if {handel:%player%:open} is true:
- set {_converted} to arg 2 parsed as number
- if {_converted} is set:
- add player's tool to {handel:%player%:itemlist::*}
- add {_converted} to {handel:%player%:itemprices::*}
- remove player's tool from player
- send "{@tag} &aDodano przedmiot do sklepu!" to player
- else:
- send "{@tag} &cPodaj prawidlowa cene!"
- stop
- if arg 1 is "uitem":
- if {handel:%player%:open} is false:
- send "{@tag} &cNie posiadasz Sklepu"
- stop
- if {handel:%player%:open} is true:
- open chest with {handel:%player%:ilocs} rows named "&9&lUsuwanie przedmiotow..." to player
- wait 1 tick
- set {_slot} to 0
- loop {handel:%player%:itemlist::*}:
- set {_a} to loop-index parsed as integer
- set {_b} to player
- format slot {_slot} of player with loop-value to run [usunPrzedmiot({_a}, {_b})]
- wait 2 tick
- add 1 to {_slot}
- stop
- if arg 1 is "podglad":
- if {handel:%player%:open} is false:
- send "{@tag} &cNie posiadasz Sklepu"
- stop
- if {handel:%player%:open} is true:
- open chest with {handel::%player%::iloscLinii} rows named "&eSklep » &7%name of player%" to player
- set {_slot} to 0
- loop {handel:%player%:itemlist::*}:
- set {_item} to loop-value with lore "&cCena: %{handel:%player%:itemprices::%loop-index%}%"
- format slot {_slot} of player with {_item} to be unstealable
- add 1 to {_slot}
- stop
- if arg 1 is "powieksz":
- if {handel::%player%::iloscLinii} is equal to {@maxLinijek}:
- send "{@tag} &aPosiadasz maksymalna ilosc linijek!"
- stop
- open chest with 3 rows named "&9&lPowieksz" to player
- wait 1 tick
- if player has permission "{@vipPerm}":
- set {_c} to {@cenaV}
- else:
- set {_c} to {@cena}
- set {_x} to {_c} * {@startoweLinijki}
- set {_l} to {handel::%player%::iloscLinii} + 1
- set {_cen} to {_l} * {_c}
- set {_cena} to {_cen} - {_x}
- format slot 10 of player with {handel::%player%::iloscLinii} of workbench named "&9&lPowieksz Sklep" with lore "&6Koszt&8: &7%{_cena}%" to run [powiekszSklep(player)]
- stop
- if arg 1 is "setsklepy":
- if player has permission "sklep.setmiejsce":
- set {handel::miejsce} to location of player
- send "{@tag} &aUstawiles miejsce zakladania sklepow"
- stop
- if arg 1 is "otworz":
- if {handel:%player%:open} is false:
- send "{@tag} &cNie posiadasz Sklepu"
- stop
- if {handel:%player%:open} is true:
- set {handel:%player%:otwarty} to true
- send "{@tag} &aTwoj sklep jest teraz otwarty!"
- send "{@tag} &7Aby go zamknac wpisz:"
- send "{@tag} &6/sklep zamknij"
- if player has permission "{@vipPerm}":
- "%player's name%".Hologram.change{"&6Sklep gracza %name of player%"};
- else:
- "%player's name%".Hologram.change{"&eSklep gracza %name of player%"};
- set {_y} to player's y-coordinate + 1.25
- set {_loc} to location at player's x-coordinate, {_y}, player's z-coordinate of the world world of player
- "%player's name%".Hologram.show{{_loc}}
- if arg 1 is "zamknij":
- if {handel:%player%:open} is false:
- send "{@tag} &cNie posiadasz Sklepu"
- stop
- if {handel:%player%:open} is true:
- set {handel:%player%:otwarty} to false
- send "{@tag} &cTwoj sklep jest teraz zamkniety!"
- if player has permission "{@vipPerm}":
- "%player's name%".Hologram.change{"&6Sklep gracza %name of player% (zamkniety)"};
- else:
- "%player's name%".Hologram.change{"&eSklep gracza %name of player% (zamkniety)"};
- set {_y} to player's y-coordinate + 1.25
- set {_loc} to location at player's x-coordinate, {_y}, player's z-coordinate of the world world of player
- "%player's name%".Hologram.show{{_loc}}
- if arg 1 is not "zaloz" or "usun" or "ditem" or "uitem" or "podglad" or "powieksz" or "pomoc" or "otworz" or "zamknij":
- send "{@tag} &cNieznana komenda! &4/sklep"
- stop
- on jump:
- if {handel:%player%:open} is true:
- cancel event
- on quit:
- if {handel:%player%:open} is true:
- execute player command "sklep usun"
- on kick:
- if {handel:%player%:open} is true:
- execute player command "sklep usun"
- on rightclick on player:
- if {handel:%target player%:open} is true:
- if {handel:%target player%:otwarty} is false:
- send "{@tag} &eTen sklep jest zamkniety!"
- stop
- open chest with {handel::%target player%::iloscLinii} rows named "&eSklep » &7%name of target player%" to player
- wait 2 tick
- set {_slot} to 0
- loop {handel:%target player%:itemlist::*}:
- set {_item} to loop-value with lore "&cCena: %{handel:%target player%:itemprices::%loop-index%}%"
- set {_a} to loop-index parsed as integer
- set {_b} to {handel:%target player%:itemprices::%loop-index%}
- set {_c} to target player
- set {_d} to player
- format slot {_slot} of player with {_item} to run [modal({_a}, {_b}, {_c}, {_d})]
- wait 2 tick
- add 1 to {_slot}
- on join:
- if {handel::%player%::iloscLinii} is not set:
- set {handel::%player%::iloscLinii} to {@startoweLinijki}
- every 1 minute:
- loop all players:
- if {handel:%loop-player%:open} is true:
- if {handel:%loop-player%:otwarty} is false:
- send "{@tag} &7Twoj sklep nie jest jeszcze otwarty, aby go otworzyć wpisz: " to loop-player
- send "{@tag} &6/sklep otworz" to loop-player
Advertisement
Add Comment
Please, Sign In to add comment