benibilenbilir
Java / Skripter
- Katılım
- 10 Temmuz 2019
- Mesajlar
- 702
- Elmaslar
- 405
- Puan
- 5.825
- Yaş
- 22
- Konum
- İstanbul
- Minecraft
- Mete
Discord:
! metemoii#9257
Merhabalar değerli forum üyeleri bugün sizlere kodlamış olduğum bÇiftçi skriptini tanıtmak istyorum fazla uzatmadan geçelim. :d
Komut: /ciftci
Satma:
Depodan alma & Satma
Bir oyuncunun Stok durumunu öğrenme:
Eğer config.yml ayarlanan max depo oyucunun stoğunu aşıyorsa, kaktüsleri toplamayı bırakır ve uyarı mesajı gönderir.
Ayarlanabilir yaml destekli gui ve fiyatlandırma:
Konu tasarım içinde @Tugratanr teşekür ederim. <3
Skriptde neleri beğenip beğenmediğiniz yorumlarda belirtebilirisiniz, iyi forumlar :)
Eğer heran gibi hata, bug tarzı bir şey yakalarsınız lütfen bildirmeyi unutmayın: Mete#9999
*Melodia olarak ücretsiz paylaşımlara devam edeceğiz.*
Komut: /ciftci
Satma:
Depodan alma & Satma
Bir oyuncunun Stok durumunu öğrenme:
Eğer config.yml ayarlanan max depo oyucunun stoğunu aşıyorsa, kaktüsleri toplamayı bırakır ve uyarı mesajı gönderir.
Ayarlanabilir yaml destekli gui ve fiyatlandırma:
Kod:
# __ __ _ _ _
# | \/ | ___| | ___ __| (_) __ _
# | |\/| |/ _ \ |/ _ \ / _` | |/ _` |
# | | | | __/ | (_) | (_| | | (_| |
# |_| |_|\___|_|\___/ \__,_|_|\__,_|
# Yapımcı: benibilenbilir
# v0.1 bÇiftçi (sadece Kaktüs) toplar. depo dolunca toplamayı bırakır.
# GUI Lore, fiyat gibi şeyler Ciftci/config.yml'den ayarlanabilir.
# İyi kullanımlar :)
# Gerekli Addonlar:
# - WolvSK
# Config
on script load:
load yaml "Ciftci/config.yml" as "config"
if yaml "config" is empty:
set yaml value "Prefix" from "config" to " &6Çiftçi &8►"
save yaml "config"
set {prefix} to yaml value "Prefix" from "config"
set {ciftci::slot} to yaml value "ciftci.kaktus.slot" from "config"
set {ciftci::lore::*} to yaml list "ciftci.kaktus.lore" from "config"
set {ciftci::max_depo} to yaml value "max_depo" from "config"
set {ciftci::fiyat} to yaml value "ciftci.kaktus.fiyat" from "config"
replace all "{CACTUS_DEPO}" with "%{ciftci::max_depo}%" in {ciftci::lore::*}
# İlk defa katılıyorsa {depo::%player%::cactus} değişkeni 0 yapsın,
on first join:
set {depo::%player%::cactus} to 0
# Büyüme işlemi
on grow:
if event-item is cactus:
wait a tick
farmingDropped(("%asb island at event-location owner%" parsed as offlineplayer), event-block)
# Ciftci komutu
command /ciftci [<offlineplayer>]:
trigger:
if arg-1 isn't set:
if event-player is in "askyblock":
getFarmer("ciftci", player)
else:
send "%{prefix}% &cBu komutu sadece adanda kullanabilirisin!"
play "ANVIL_LAND" to the event-player at volume 5
else:
if arg-1 has played on this server before:
if {depo::%arg-1%::cactus} isn't set:
set {depo::%arg-1%::cactus} to 0
send "&8▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬" and ""
send " &bÇiftçi" and ""
send " &8▪ &7Sahibi: &6%arg-1%"
send " &8▪ &7Mevcut Stoğu: &e%{depo::%arg-1%::cactus}%&8/&a%{ciftci::max_depo}% &8(&bKaktüs&8)"
send "" and "&8▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬"
play "LEVEL_UP" to the event-player at volume 5
else:
send "%{prefix}% &e%arg-1% &7adlı oyuncu daha önce hiç oynamamış bu serverda. :("
play "ANVIL_LAND" to the event-player at volume 5
# Fonksiyonlar
function getFarmer(gui: text, p: player):
if {_gui} is "ciftci":
open virtual chest with size 1 named "&6Çiftçi" to {_p}
make gui slot (integers between 0 and 8) of {_p} with (gray stained glass pane named " ") to do nothing
set {_lore::*} to {ciftci::lore::*}
replace all "{CACTUS}" with "%{depo::%{_p}%::cactus}%" in {_lore::*}
make gui slot 4 of {_p} with (cactus named "&bKaktüs" with lore colored join {_lore::*} with "||") to do nothing
function farmingDropped(owner: player, block: block):
loop all entities in radius 1 of {_block}:
if "%item of entity loop-entity%" is "cactus":
if {depo::%{_owner}%::cactus} < {ciftci::max_depo}:
delete loop-entity
add 1 to {depo::%{_owner}%::cactus}
else:
wait 2 ticks
if {_owner} is online:
show action bar "%{prefix}% &cKaktüs stoğu nerdeyse dolu!" to {_owner}
play "ENDERDRAGON_HIT" to {_owner} at volume 5
# Satma & Alma
on inventory click:
if inventory name of player's current inventory = "&6Çiftçi":
clicked slot is 4:
cancel event
if "%click type%" contains "LEFT":
if {depo::%player%::cactus} >= 64:
remove 64 from {depo::%player%::cactus}
give 64 cactus to event-player
play "LEVEL_UP" to the event-player at volume 5
else:
send "%{prefix}% &7Stoğun'da yeterince ürün yok. &e%{depo::%player%::cactus}%&8/&c64"
play "ANVIL_LAND" to the event-player at volume 5
if "%click type%" contains "RIGHT":
if {depo::%player%::cactus} >= 1:
set {_miktar} to {depo::%player%::cactus} * {ciftci::fiyat}
add {_miktar} to balance of event-player
send "%{prefix}% &b%{depo::%player%::cactus}% adet Kaktüs, &e%{_miktar}% TL &7karşılığı satıldı." to event-player
remove {depo::%player%::cactus} from {depo::%player%::cactus}
play "LEVEL_UP" to the event-player at volume 5
else:
send "%{prefix}% &7Deponuzda nerdeyse hiç ürün yok :/"
play "ANVIL_LAND" to the event-player at volume 5
getFarmer("ciftci", event-player)
config.yml
YAML:
Prefix: ' &6Çiftçi &8►'
max_depo: 2000
ciftci:
kaktus:
slot: 4
lore:
- ''
- ' &8▪ &7Stok: &e{CACTUS}&8/&a{CACTUS_DEPO}'
- ' &8▪ &7Fiyat: &f0.5 TL'
- ''
- ' &cAlmak için sol tıkla &8(&764 adet&8)'
- ' &cSatmak için sağ tıkla &8(&7Hepsi&8)'
- ''
fiyat: 0.5
Konu tasarım içinde @Tugratanr teşekür ederim. <3
Skriptde neleri beğenip beğenmediğiniz yorumlarda belirtebilirisiniz, iyi forumlar :)
Eğer heran gibi hata, bug tarzı bir şey yakalarsınız lütfen bildirmeyi unutmayın: Mete#9999
*Melodia olarak ücretsiz paylaşımlara devam edeceğiz.*
Son düzenleme: