# 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"