Bulundu Sayaç Skript

  • Konuyu Başlatan Konuyu Başlatan Yasuoxdx
  • Başlangıç tarihi Başlangıç tarihi
  • Görüntüleme 184
Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...

Yasuoxdx

Yay Yok, İskelet Yok
Katılım
23 Haziran 2017
Mesajlar
315
Elmaslar
43
Puan
13.870
Minecraft
Azelora

Discord:

kyjons

Detaylı anlatmam gerekirse, /sayaç <başlat> komutunu girince sayaç çalışmaya başlicak ve bu süreyi gün,saat,dakika ve saniye olarak holograma yansıtmak istiyorum. Örnek vermek gerekirse, 6 gün geriye doğru sayım yapıcak en sonda yani istenilen süreyi tamamlayınca vakit tamamlandı gibi mesaj vermesini istiyorum. Eğer süreyi yanlış veya değiştirmem gerekirse /sayaç <sıfırla> komutu ile sıfırlamak istiyorum.

Yardımcı olacaklara şimdiden teşekkürler.
 
Discord: vearthx bana dicord üzerinden ulaşır mısınız?
 
JavaScript:
# Sayaç Skript'i
# Skript Sürümü: 2.8.7
# Gerekli Eklentiler: SkBee veya Holographic Displays

variables:
    {countdown.isActive} = false # Sayaç aktif mi?
    {countdown.remainingTime} = 0 # Geriye kalan toplam süre (saniye cinsinden)
    {countdown.hologramID} = "" # Hologram ID'si
    {countdown.startingTime} = 0 # Sayaç başlangıç zamanı (saniye cinsinden)

# /sayaç komutu - Sayaç yönetimi
command /sayaç <text>:
    permission: countdown.use
    trigger:
        if arg 1 is "başlat":
            if {countdown.isActive} is true:
                send "&cSayaç zaten aktif durumda!" to player
            else:
                set {countdown.remainingTime} to 6 * 24 * 60 * 60 # 6 gün (saniye cinsinden)
                set {countdown.startingTime} to {countdown.remainingTime}
                set {countdown.isActive} to true
                send "&aSayaç başlatıldı! Geriye kalan süre: &e6 gün" to player
                create hologram "&eGeriye Kalan Süre:" with id "countdownHolo" at location of player
                updateCountdownHologram()
        else if arg 1 is "sıfırla":
            if {countdown.isActive} is false:
                send "&cSayaç zaten kapalı durumda!" to player
            else:
                delete {countdown.remainingTime}
                delete {countdown.startingTime}
                delete {countdown.isActive}
                if {countdown.hologramID} is set:
                    delete hologram with id "countdownHolo"
                send "&aSayaç sıfırlandı ve durduruldu." to player

# Sayaç güncelleme fonksiyonu
function updateCountdownHologram():
    while {countdown.isActive} is true:
        wait 1 second
        if {countdown.remainingTime} <= 0:
            set {countdown.isActive} to false
            delete hologram with id "countdownHolo"
            broadcast "&eSayaç süresi doldu! &6Vakit tamamlandı."
            stop
        else:
            set {countdown.remainingTime} to {countdown.remainingTime} - 1
            set {_days} to {countdown.remainingTime} / (24 * 60 * 60)
            set {_hours} to ({countdown.remainingTime} % (24 * 60 * 60)) / (60 * 60)
            set {_minutes} to ({countdown.remainingTime} % (60 * 60)) / 60
            set {_seconds} to {countdown.remainingTime} % 60
            set {_hologramText} to "&eGeriye Kalan Süre: &b%{_days}% gün, %{_hours}% saat, %{_minutes}% dakika, %{_seconds}% saniye"
            if {countdown.hologramID} is set:
                set hologram line 1 of hologram with id "countdownHolo" to {_hologramText}
            else:
                create hologram {_hologramText} with id "countdownHolo" at location of player
                set {countdown.hologramID} to "countdownHolo"
 
8 error verdi, SkBee ve Holographic Displays sunucuda mevcut.

Kod:
[21:15:50 INFO]: Line 44: (test.sk)
[21:15:50 INFO]:     Can't understand this condition/effect: delete hologram with id "countdownHolo"
[21:15:50 INFO]:     Line: delete hologram with id "countdownHolo"
[21:15:50 INFO]:
[21:15:50 INFO]: Line 50: (test.sk)
[21:15:50 INFO]:     Can't understand this expression: '({countdown.remainingTime} % (24 * 60 * 60)) / (60 * 60)'
[21:15:50 INFO]:     Line: set {_hours} to ({countdown.remainingTime} % (24 * 60 * 60)) / (60 * 60)
[21:15:50 INFO]:
[21:15:50 INFO]: Line 51: (test.sk)
[21:15:50 INFO]:     Can't understand this expression: '({countdown.remainingTime} % (60 * 60)) / 60'
[21:15:50 INFO]:     Line: set {_minutes} to ({countdown.remainingTime} % (60 * 60)) / 60
[21:15:50 INFO]:
[21:15:50 INFO]: Line 52: (test.sk)
[21:15:50 INFO]:     Can't understand this expression: '{countdown.remainingTime} % 60'
[21:15:50 INFO]:     Line: set {_seconds} to {countdown.remainingTime} % 60
[21:15:50 INFO]:
[21:15:50 INFO]: Line 55: (test.sk)
[21:15:50 INFO]:     Can't understand this condition/effect: set hologram line 1 of hologram with id "countdownHolo" to {_hologramText}
[21:15:50 INFO]:     Line: set hologram line 1 of hologram with id "countdownHolo" to {_hologramText}
[21:15:50 INFO]:
[21:15:50 INFO]: Line 57: (test.sk)
[21:15:50 INFO]:     There's no player in a function event
[21:15:50 INFO]:     Line: create hologram {_hologramText} with id "countdownHolo" at location of player
[21:15:50 INFO]:
[21:15:50 INFO]: Line 25: (test.sk)
[21:15:50 INFO]:     Can't understand this condition/effect: create hologram "&eGeriye Kalan Süre:" with id "countdownHolo" at location of player
[21:15:50 INFO]:     Line: create hologram "&eGeriye Kalan Süre:" with id "countdownHolo" at location of player
[21:15:50 INFO]:
[21:15:50 INFO]: Line 35: (test.sk)
[21:15:50 INFO]:     Can't understand this condition/effect: delete hologram with id "countdownHolo"
[21:15:50 INFO]:     Line: delete hologram with id "countdownHolo"
 
Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...

Hala Discord sunucumuza katılmadın mı?

Büyük bir topluluğun parçası ol, etkinliklere katıl ve özel hediyeler kazanma şansı yakala!

Şimdi Katıl
Üst