- Katılım
- 26 Şubat 2020
- Mesajlar
- 87
- En iyi cevaplar
- 2
- Tepki puanı
- 16
- Puanları
- 1,080
- Oyuncular /odul komutu ile GUI üzerinden Günlük, Haftalık, Aylık ödül alabilir.
- Her ödül tipi kendi cooldown süresine sahiptir.
- Alınan ödül, oyuncunun veri dosyasında saklanır ve süresi dolmadan tekrar alınamaz.
- GUI ile etkileşimli ve kullanıcı dostudur.
Gerekli Addonlar:
- SkBee (GUI ve NBT)
- SkUtilities veya skript-yaml (veri kaydı için)
- SkQuery (görsel efektler ve GUI için)
JavaScript:
options:
prefix: &6[Ödül]
gui-name: &8» &eÖdül Menüsü
günlük-cooldown: 1 day
haftalık-cooldown: 7 days
aylık-cooldown: 30 days
command /odul:
trigger:
open virtual chest with size 3 rows named "{@gui-name}" to player
wait 1 tick
format gui slot 11 of player with lime stained glass named "&aGünlük Ödül" with lore "&7Her gün alabilirsin!" to close then run [execute console command "/gunlukodul %player%"]
format gui slot 13 of player with yellow stained glass named "&eHaftalık Ödül" with lore "&7Her 7 günde bir alabilirsin!" to close then run [execute console command "/haftalikodul %player%"]
format gui slot 15 of player with red stained glass named "&cAylık Ödül" with lore "&7Her 30 günde bir alabilirsin!" to close then run [execute console command "/aylikodul %player%"]
function checkCooldown(p: player, type: text, cooldown: timespan) :: boolean:
if yaml value "%{_p}'s.%{_type}%" from file "plugins/Skript/data/oduller.yml" is set:
set {_last} to yaml value "%{_p}'s.%{_type}%" from file "plugins/Skript/data/oduller.yml"
if difference between now and {_last} < {_cooldown}:
return false
return true
function setCooldown(p: player, type: text):
set yaml value "%{_p}'s.%{_type}%" from file "plugins/Skript/data/oduller.yml" to now
save yaml file "plugins/Skript/data/oduller.yml"
command /gunlukodul [<offline player>]:
trigger:
if arg is set:
set {_p} to arg
else:
set {_p} to player
if checkCooldown({_p}, "gunluk", {@günlük-cooldown}) is false:
send "{@prefix} &cGünlük ödülünü zaten aldın!" to {_p}
stop
give 1 diamond to {_p}
give 3 golden apple to {_p}
send "{@prefix} &aGünlük ödülünü aldın!" to {_p}
setCooldown({_p}, "gunluk")
command /haftalikodul [<offline player>]:
trigger:
if arg is set:
set {_p} to arg
else:
set {_p} to player
if checkCooldown({_p}, "haftalik", {@haftalık-cooldown}) is false:
send "{@prefix} &cHaftalık ödülünü zaten aldın!" to {_p}
stop
give 5 diamond to {_p}
give 1 enchanted golden apple to {_p}
give 1 netherite ingot to {_p}
send "{@prefix} &eHaftalık ödülünü aldın!" to {_p}
setCooldown({_p}, "haftalik")
command /aylikodul [<offline player>]:
trigger:
if arg is set:
set {_p} to arg
else:
set {_p} to player
if checkCooldown({_p}, "aylik", {@aylık-cooldown}) is false:
send "{@prefix} &cAylık ödülünü zaten aldın!" to {_p}
stop
give 10 diamond block to {_p}
give 5 enchanted golden apple to {_p}
give 3 netherite ingot to {_p}
send "{@prefix} &cAylık ödülünü aldın!" to {_p}
setCooldown({_p}, "aylik")
Kurulum:
- plugins/Skript/scripts/odul.sk dosyasına yapıştır.
- SkBee, SkQuery, skript-yaml eklentilerini yükle.
- Sunucunu yeniden başlat ya da /sk reload odul komutunu kullan.
- Oyunda /odul yazarak GUI menüsünü test et.