Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # PETY by MiniGameShoot
- # Proszę tego nie usuwać!
- on script load:
- if folder "plugins/Skript/scripts/pety" doesn't exists:
- create folder "plugins/Skript/scripts/pety"
- if file "plugins/Skript/scripts/pety/config.yml" doesn't exists:
- create file "plugins/Skript/scripts/pety/config.yml"
- #wf "pety:" to "plugins/Skript/scripts/pety/config.yml"
- #wf "- 'wolf'" to "plugins/Skript/scripts/pety/config.yml"
- #wf "- 'pig'" to "plugins/Skript/scripts/pety/config.yml"
- #wf "- 'sheep'" to "plugins/Skript/scripts/pety/config.yml"
- set yaml value "wysokosctabeli" from "pety/config.yml" to "4"
- set yaml value "pety.pig.create" from "pety/config.yml" to "true"
- set yaml value "pety.pig.lore" from "pety/config.yml" to "&eTo jest podstawowy opis || pig "
- set yaml value "pety.wolf.create" from "pety/config.yml" to "true"
- set yaml value "pety.wolf.lore" from "pety/config.yml" to "&eTo jest podstawowy opis || wolf "
- set yaml value "pety.sheep.create" from "pety/config.yml" to "true"
- set yaml value "pety.sheep.lore" from "pety/config.yml" to "&eTo jest podstawowy opis || sheep "
- if file "plugins/Skript/scripts/pety/gracze.yml" doesn't exists:
- create file "plugins/Skript/scripts/pety/gracze.yml"
- on first join:
- set yaml value "%name of player%.nazwapeta" from "pety/gracze.yml" to "%name of player%"
- on join:
- set yaml value "%name of player%.online" from "pety/gracze.yml" to "true"
- set yaml value "%name of player%.nazywa" from "pety/gracze.yml" to "false"
- set yaml value "%name of player%.ruch" from "pety/gracze.yml" to "true"
- if slot 8 of player is air:
- wait tick
- set slot 8 of player to bone named "&aPety"
- on quit:
- set yaml value "%name of player%.online" from "pety/gracze.yml" to "false"
- loop all entities:
- if {pet::%loop-entity%} is set:
- set {_petname} to yaml value "%player%.nazwapeta" from "pety/gracze.yml"
- if name of loop-entity is {_petname}:
- kill loop-entity
- command /ustawpet:
- trigger:
- set yaml value "%name of player%.nazwapeta" from "pety/gracze.yml" to "%name of player%"
- on right click:
- if player's tool is bone named "&aPety":
- wait tick
- function "pety.gui" {player};
- on right click on entity:
- if {pet::%clicked entity%} is set:
- if {pet::%clicked entity%} = name of player:
- wait 1 tick
- open chest with 1 rows named "&eMenu Peta" to player
- wait 1 tick
- format slot 0 of player with 1 of minecart named "&bJazda" with lore "&eKliknij, aby jezdzic || na swoim pecie" to close then run "sudo %player% pety jazda"
- format slot 1 of player with 1 of name tag named "&bNazwij" with lore "&eKliknij, aby nazwac || peta" to close then run "sudo %player% pety nazwij"
- format slot 2 of player with 1 of green wool named "&bPodazaj" with lore "&eKliknij, aby pet za toba || chodzil" to close then run "sudo %player% pety ruch"
- format slot 3 of player with 1 of red wool named "&bZatrzymaj" with lore "&eKliknij, aby twoj pet stal || w miejscu" to close then run "sudo %player% pety stoj"
- format slot 8 of player with 1 of redstone block named "&6>> &c&lZamknij&6 <<" to close
- command /pety [<text=gui>] [<text=entity type>] [<text>]:
- trigger:
- if arg 1 is "help":
- send "&e/pety gui"
- send "&e/pety setname [nazwa i zamiast spacji prosze dac _]"
- send "&e/pety jazda"
- send "&e/pety nazwij"
- send "&e/pety ruch"
- send "&e/pety stoj"
- if player have permissions "pety.*":
- send "&c/pety stworz [nazwa moba pisana z malej litery]"
- send "&c/pety setlore [opis i zamiast spacji prosze dac _]"
- if arg 1 is "gui":
- function "pety.gui" {player and "1"};
- if arg 1 is "stworz":
- if arg 2 is set:
- if player have permissions "pety.*":
- if arg 2 is set:
- set {_pety} to yaml value "pety.%arg 2%.create" from "pety/config.yml"
- if {_pety} is not set:
- set yaml value "pety.%arg 2%.create" from "pety/config.yml" to "true"
- set yaml value "pety.%arg 2%.lore" from "pety/config.yml" to "&eTo jest podstawowy opis || %arg 2% "
- send "&eDodales %arg 2% do listy petow!"
- else:
- send "&eIstnieje juz taki pet!"
- else:
- send "&eNie wpisales nazwy moba!"
- if arg 1 is "setlore":
- if arg 2 is set:
- if arg 3 is set:
- if player have permissions "pety.*":
- set {_pety} to yaml value "pety.%arg 2%.create" from "pety/config.yml"
- if {_pety} is not set:
- send "&eNie ma takiego peta!"
- else:
- set {_msg} to arg 3
- replace all "_" with " " in {_msg}
- replace all "&" with "ยง" in {_msg}
- set yaml value "pety.%arg 2%.lore" from "pety/config.yml" to "%{_msg}%"
- send "&eUstawiles opis %arg 2% na %{_msg}%"
- if arg 1 is "setname":
- if arg 2 is set:
- set {_nazwap} to yaml value "%player%.nazwapeta" from "pety/gracze.yml"
- loop all entities:
- if name of loop-entity is "%{_nazwap}%":
- kill loop-entity
- wait 1 second
- set {_nazwa} to arg 2
- replace all "_" with " " in {_nazwa}
- set {_nazwa} to colored {_nazwa}
- set yaml value "%player%.nazwapeta" from "pety/gracze.yml" to "%{_nazwa}%"
- send "&eNazwales peta %{_nazwa}%"
- if arg 1 is "jazda":
- loop all entities:
- if {pet::%loop-entity%} is set:
- set {_petname} to yaml value "%player%.nazwapeta" from "pety/gracze.yml"
- if name of loop-entity is {_petname}:
- set {_p} to location of player
- set {_locpet} to location of loop-entity
- if distance between {_locpet} and {_p} <= 6:
- make the player ride loop-entity
- while player's vehicle is loop-entity:
- push loop-entity in direction of player at speed 0.1
- if block in front of player is not air:
- push loop-entity upwards at speed 0.1
- wait 3 ticks
- wait 1 tick
- else:
- send "&eTwoj pet jest za dalego lub nie zostal przywolany"
- if arg 1 is "nazwij":
- set yaml value "%name of player%.nazywa" from "pety/gracze.yml" to "true"
- send "&eNapisz nazwe peta na czacie"
- if arg 1 is "ruch":
- set yaml value "%name of player%.ruch" from "pety/gracze.yml" to "true"
- if arg 1 is "stoj":
- set yaml value "%name of player%.ruch" from "pety/gracze.yml" to "false"
- on chat:
- set {_nazwa} to yaml value "%player%.nazywa" from "pety/gracze.yml"
- if {_nazwa} is "true":
- cancel event
- set {_nazwap} to yaml value "%player%.nazwapeta" from "pety/gracze.yml"
- loop all entities:
- if name of loop-entity is "%{_nazwap}%":
- kill loop-entity
- wait 1 second
- set {_nazwa} to message
- replace all "_" with " " in {_nazwa}
- set {_nazwa} to colored {_nazwa}
- set yaml value "%player%.nazwapeta" from "pety/gracze.yml" to "%{_nazwa}%"
- send "&eNazwales peta %{_nazwa}%"
- set yaml value "%name of player%.nazywa" from "pety/gracze.yml" to "false"
- on damage:
- if {pet::%victim%} is set:
- cancel event
- if {pet::%attacker%} is set:
- cancel event
- on death:
- if {pet::%victim%} is set:
- clear drops
- command /getpet [<player>] <entity type>:
- trigger:
- if arg 1 is set:
- if arg 2 is set:
- set {_pety} to yaml value "pety.%arg 2%.create" from "pety/config.yml"
- if {_pety} is not set:
- send "&eNie ma takiego peta!"
- else:
- loop all entities:
- if {pet::%loop-entity%} is set:
- set {_petname} to yaml value "%player-arg%.nazwapeta" from "pety/gracze.yml"
- if name of loop-entity is {_petname}:
- kill loop-entity
- set {_pet} to arg 2
- set {_pet} to {_pet} parsed as entity type
- spawn {_pet} at location of player-arg
- set {_nazwapeta} to yaml value "%player-arg%.nazwapeta" from "pety/gracze.yml"
- set {pet::%last spawned entity%} to player-arg
- set name of last spawned entity to "%{_nazwapeta}%"
- every second:
- loop all entities:
- if {pet::%loop-entity%} is set:
- set {_name} to {pet::%loop-entity%}
- set {_online} to yaml value "%{_name}%.online" from "pety/gracze.yml"
- set {_ruch} to yaml value "%{_name}%.ruch" from "pety/gracze.yml"
- set {_name} to {_name} parsed as player
- set {_pet} to loop-entity
- set {_locpet} to location of loop-entity
- if {_online} is "true":
- if {_ruch} is "true":
- if distance between {_locpet} and {_name} >= 6:
- set {_loc} to location of {_name}
- teleport {_pet} to {_loc}
- on any move:
- if {pet::%event-entity%} is set:
- set {_name} to {pet::%event-entity%}
- set {_ruch} to yaml value "%{_name}%.ruch" from "pety/gracze.yml"
- set {_ruch} to {_ruch} parsed as text
- if {_ruch} is false:
- cancel event
- method "pety.gui" {gracz}:
- set {_g} to arg{1};
- set {_pety::*} to configuration section "pety" get of "plugins/Skript/scripts/pety/config.yml"
- set {_wys} to single value "wysokosctabeli" get of "plugins/Skript/scripts/pety/config.yml"
- set {_wysokosc} to {_wys} parsed as number
- wait tick
- open chest with {_wysokosc} rows named "&4&n&lPety" to {_g}
- wait 3 ticks
- loop {_pety::*}:
- add 1 to {_slot}
- set {_lore} to yaml value "pety.%loop-value%.lore" from "pety/config.yml"
- set {_pet} to loop-value
- set {_pet} to {_pet} parsed as entity type
- format slot {_slot}-1 of {_g} with 1 of bottle of enchanting named "&a&l%{_pet}%" with lore "%{_lore}%" to close then run "getpet %{_g}% %{_pet}% "
- format slot 22 of {_g} with 1 of redstone block named "&6>> &c&lPowrot&6 <<" to close
Advertisement
Add Comment
Please, Sign In to add comment