Kemalist1881
Kömür Madencisi
- Mesajlar
- 126
- En iyi cevaplar
- 0
- Beğeniler
- 21
- Puanları
- 0
Selam, ben Kemalist1881 bugün sizlere kodladığım pet skriptini tanıtacağım.
Özellikler/Features
Özellikler/Features
- GUI : Menu ile pet seçebilirsiniz.
- BOARD: Board ile skor tablosunda bilgileri görebilirisiniz.
- 4 OPTIONS: Şu anlık sadece 4 tane seçenek var ekleyebilirsiniz.
- PVP: PVP (Player vs Player)'i petlere vurmayı kapatabilirsiniz.
- CONFIG: Config ile kendi ayarlarınızı yapabilirsiniz.
CODE:
PHP:
#Authors: Kemalist1881 & EgeFTW
#Version: 1.0
#commands:
#/pet
#Config:
options:
prefix: &exPet&7>
noperm: &cYou don't have permission&8!
pvp: false
sidebar: true
sidebarprefix: xPet
command /pet:
trigger:
open chest with 2 rows named "&7XPET" to player
wait 1 tick
format slot 0 of player with leather named "&7Cow &apet" with lore "&aSpawn &7cow&8!" to close then run [make player execute command "/xpetsystem create cow"]
format slot 1 of player with shears named "&7Sheep &apet" with lore "&aSpawn &7sheep&8!" to close then run [make player execute command "/xpetsystem create sheep"]
format slot 9 of player with carrot on a stick named "&7Pig &apet" with lore "&aSpawn &7pig&8!" to close then run [make player execute command "/xpetsystem create pig"]
format slot 10 of player with egg named "&7Chicken &apet" with lore "&aSpawn &7chicken&8!" to close then run [make player execute command "/xpetsystem create chicken"]
format slot 8 of player with ender pearl named "&aCall" with lore "&7Call your pet&8!" to close then run [make player execute command "/xpetsystem call"]
format slot 7 of player with paper named "&aAbout" with lore "&7Coded by &cKemalist1881&8!||&7Version&8: &61.0&8!||&e4 &7pets options&8!||&7GUI menu&8!" to close
format slot 17 of player with block of redstone named "&4Delete" with lore "&cDelete your pet&8!" to close then run [make player execute command "/xpetsystem delete"]
format slot 16 of player with diamond sword named "&4PVP" with lore "&cPVP is {@pvp}&8!" to close then run [make player execute command "/xpetsystem delete"]
command /petbug:
permission: pet.bug
permission message: {@prefix} {@noperm}
trigger:
set {petis.%player%} to false
send "{@prefix} &eBug is deleted&8!"
on join:
wait 15 ticks
while player is online:
if {@sidebar} is true:
wait 15 ticks
wipe player's sidebar
set name of sidebar of player to "&8&m---&b&l{@sidebarprefix}&8&m---"
set score "&7You pet&8: &e%{pet.%player%}%" in sidebar of player to 0
command /xpetsystem [<text>] [<text>]:
permission: pet.system
permission message: {@prefix} {@noperm}
trigger:
if arg 1 is set:
if arg 1 is "create":
if arg 2 is set:
if {petis.%player%} is false:
if arg 2 is "cow":
spawn 1 cow at player's location
set name of spawned cow to "%colored player's prefix%%player%&7's pet"
set {petis.%player%} to true
set {pet.%player%} to "cow"
set {_cow} to spawned entity
send "{@prefix} &aSuccessfully new &ecow &apet&8!"
while {_cow} is alive:
make {_cow} pathfind to player with speed 1.5
wait 3 tick
while {_cow} isn't alive:
stop
if arg 2 is "sheep":
spawn 1 sheep at player's location
set name of spawned sheep to "%colored player's prefix%%player%&7's pet"
set {petis.%player%} to true
set {pet.%player%} to "sheep"
set {_sheep} to spawned entity
send "{@prefix} &aSuccessfully new &esheep &apet&8!"
while {_sheep} is alive:
make {_sheep} pathfind to player with speed 1.5
wait 3 tick
while {_sheep} isn't alive:
stop
if arg 2 is "pig":
spawn 1 pig at player's location
set {petis.%player%} to true
set {pet.%player%} to "pig"
set name of spawned pig to "%colored player's prefix%%player%&7's pet"
set {_pig} to spawned entity
send "{@prefix} &aSuccessfully new &epig &apet&8!"
while {_pig} is alive:
make {_pig} pathfind to player with speed 1.5
wait 3 tick
while {_pig} isn't alive:
stop
if arg 2 is "chicken":
spawn 1 chicken at player's location
set name of spawned chicken to "%colored player's prefix%%player%&7's pet"
set {petis.%player%} to true
set {pet.%player%} to "chicken"
set {_chicken} to spawned entity
send "{@prefix} &aSuccessfully new &echicken &apet&8!"
while {_chicken} is alive:
make {_chicken} pathfind to player with speed 1.5
wait 3 tick
while {_chickken} isn't alive:
stop
else:
send "{@prefix} &cYou have pet&8!"
send "{@prefix} &eIf delete pet to &8[&6/pet&8]!"
if arg 1 is "call":
if {petis.%player%} is true:
loop all entities:
if name of loop-entities contains "%colored player's prefix%%player%&7's pet":
teleport loop-entities to player
send "{@prefix} &eYou called &a%{pet.%player%}% &epet&8!"
else:
send "{@prefix} &cYou don't have pet&8!"
send "{@prefix} &eIf new pet to &8[&6/pet&8]!"
if arg 1 is "delete":
if {petis.%player%} is true:
loop all entities:
if name of loop-entities contains "%colored player's prefix%%player%&7's pet":
delete loop-entities
set {petis.%player%} to false
send "{@prefix} &cSuccessfully deleted pet&8!"
set {pet.%player%} to " "
else:
send "{@prefix} &cYou don't have pet&8!"
send "{@prefix} &eIf new pet to &8[&6/pet&8]!"
on damage:
if {@pvp} is false:
if name of victim contains "&7's pet":
cancel event
on death of cow or sheep or pig or chicken:
set {petis.%player%} to false
on target:
if targeted entity is a player:
if name of targeted entity contains "&7's pet":
cancel event
if targeted entity is a villager:
if name of targeted entity contains "&7's pet":
cancel event
on quit:
loop all entities:
if name of loop-entities contains "%colored player's prefix%%player%&7's pet":
set {petis.%player%} to false
delete loop-entities
stop
on load:
wait 2 seconds
loop 10 times:
send "" to console
send "&8&m--[&7xPet is &aStarted&8&m]--" to console
send "&7Coded by &cKemalist1881&8!" to console
send "&7Version&8: &61.0&8!" to console
on join:
if player has the permission "pet.staff":
loop 10 times:
send ""
wait 2 seconds
send "&7Coded by &cKemalist1881&8!"
send "&7Version&8: &61.0&8!"
on join:
if {pet.%player%} is not set:
set {pet.%player%} to " "
on teleport:
loop all entities:
if name of loop-entities contains "%colored player's prefix%%player%&7's pet":
set {petis.%player%} to false
delete loop-entities
stop