
- Katılım
- 9 Mart 2015
- Mesajlar
- 3.045
- Elmaslar
- 1.855
- Puanlar
- 19.975
- Yer
- Adıyaman
- Minecraft
- TheGaMeLiFe_HD
Discord:
BloodyX#4069
Elimde böyle bir pet skripti vardı paylaşmak istedim ne kadar saglıklı olur bilmiyorum.
Kod:
# Pet Skripti
# Evcil hayvanın sahibini ve konumunu tutmak için değişkenler
define owner as hashmap
define location as hashmap
# Evcil hayvanı oluşturmak için komut
command /spawnpet <hayvan_tipi>:
trigger:
# Hayvanın tipini al
set {petType} to lowercase of arg-1
# Oyuncunun konumu ve bakış açısı
set {playerLocation} to location of player
set {playerYaw} to yaw of player
set {playerPitch} to pitch of player
# Hayvanın oluşturulacağı konum
set {petLocation} to offset {playerLocation} by 2 blocks forward
# Hayvanı oluşturma
if {petType} is "kedi":
spawn ocelot at {petLocation}
else if {petType} is "köpek":
spawn wolf at {petLocation}
else:
send "Geçersiz hayvan tipi! Kullanılabilir tipler: kedi, köpek"
# Oluşturulan hayvanın sahibini ve konumunu kaydetme
set {owner::%last spawned entity%} to player
set {location::%last spawned entity%} to {petLocation}
# Hayvanın bakış açısını ayarlama
set head rotation of last spawned entity to {playerYaw}, {playerPitch}
# Oyuncuya mesaj gönderme
send "Evcil hayvanınız oluşturuldu!"
# Evcil hayvanı yok etmek için komut
command /removepet:
trigger:
# Oyuncunun evcil hayvanının varlığını kontrol et
if {owner::%player%} is set:
remove {owner::%player%}
remove {location::%player%}
send "Evcil hayvanınız kaldırıldı!"
else:
send "Evcil hayvanınız bulunmuyor!"
# Oyuncunun hareket ettiğinde hayvanı takip etme
event player moves:
trigger:
# Oyuncunun evcil hayvanı varsa
if {owner::%player%} is set:
# Hayvanın sahibine olan uzaklığı
set {distance} to distance between location of last spawned entity and {location::%player%}
# Hayvanı sahibine doğru hareket ettirme
if {distance} > 2 blocks:
set {direction} to unit vector from {location::%player%} to location of last spawned entity
set velocity of last spawned entity to {direction} multiplied by 0.3
/spawnpet komutu ile kedi veya kopek çagıra bilirsiniz istediğiniz gibi ayarlarsınız.
Test edicegim bir vds olmadıgı için resim ekliyemedim deneyip test eden bana ekran atarsa sevinirim.