Çözüldü Kaptan skripti yardım

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

KavuncuTV

Fırında Isıttığım İlk Taş
Katılım
2 Nisan 2021
Mesajlar
76
Elmaslar
6
Puan
8.805
Kod:
options:
    world: "world" # buraya dünya ismi gir, dünyaışınlan komutu girildiğinde bu dünyaya atacak.
    area: 300 # 300x300'lük bir alanda lokasyon bulacak.
    blacklistedUnderBlocks: lava or water or air # seçilen lokasyonun altında istenilmeyen bloklar.


command /dunyaisinlan:
    trigger:
        if world of player isn't {@world}:
            if {lastLocation::%player%} is set:
                teleport player to {lastLocation::%player%}
                play sound "block.note_block.harp" at volume 1 at pitch 0.5 to player
                play smoke at location 1 meter above player
                play smoke at location 1 meter above player
                stop


            set {_loc1} to spawn of world {@world}
            set {_loc2} to spawn of world {@world}

            set y-coord of {_loc1} to 0
            set y-coord of {_loc2} to 0


            add {@area} to {_loc1}'s x-coord
            add {@area} to {_loc1}'s z-coord

            remove {@area} from {_loc2}'s x-coord
            remove {@area} from {_loc2}'s z-coord


            set {_loc} to getRandomLocation({_loc1}, {_loc2})

            while isSafeToTeleport({_loc}) isn't true:
                add 1 to y-coord of {_loc}
                if y-coord of {_loc} > 200:
                    set {_loc} to getRandomLocation({_loc1}, {_loc2})



            teleport player to {_loc}



        else:
            send "&cBu dünyada bu komutu kullanamazsın." to player
            play sound "block.note_block.bass" at volume 1 at pitch 0.5 to player
            

on quit:
    if world of player is {@world}:
        set {lastLocation::%player%} to location of player

on teleport:
    if world of past event-location is {@world}:
        set {lastLocation::%player%} to past event-location


local function getRandomLocation(loc1: location, loc2: location) :: location:

    set {_randomX} to random number between x-coord of {_loc1} and x-coord of {_loc2}
    set {_randomZ} to random number between z-coord of {_loc1} and z-coord of {_loc2}

    set {_loc} to location(0,0,0, world of {_loc1})

    set x-coord of {_loc} to {_randomX}
    set y-coord of {_loc} to 0
    set z-coord of {_loc} to {_randomZ}


    return {_loc}




local function isSafeToTeleport(loc: location) :: boolean:

    set {_blockabove} to {_loc}
    add 1 to y-coord of {_blockabove}

    set {_block2above} to {_loc}
    add 2 to y-coord of {_block2above}

    if (block at {_loc}) or (block at {_blockabove}) or (block at {_block2above}) is solid:
        return false

    if block under {_loc} is {@blacklistedUnderBlocks}:
        return false

    if block under {_loc} isn't solid:
        return false

    return true
biraz uğraş sonucu buna çevirdim fakat ekrana yazı eklemeyi hala beceremedim ve duman efekti çok erken bitiyor süresini uzatmayı da bilmiyorum ve sanırım biraz optimize edilmesi gerekiyor rica etsem yardım edebilecek birisi var mı. Ekranda ışınlandığımız zaman Işınlandınız yazacak ve eğer olursa ışınlanmadan önce 3 saniye bekleme olmasını ve 3 den geriye ve her rakamda block.note_block.harp
sesi çalsın istiyorum
 
Son düzenleme:
Kod:
Options:
    world: "world" # buraya dünya ismi gir, dünyaışınlan komutu girildiğinde bu dünyaya atacak.
    area: 300 # 300x300'lük bir alanda lokasyon bulacak.
    blacklistedUnderBlocks: lava or water or air # seçilen lokasyonun altında istenilmeyen bloklar.


command /dunyaisinlan:
    trigger:
        if world of player isn't {@world}:
            if {lastLocation::%player%} is set:
                # Geri dönüş ışınlanması
                teleport player to {lastLocation::%player%}
                send title "&aEvine Dönülüyor!" with subtitle "&7Önceki konumuna ışınlandın." to player for 3 seconds
                play sound "block.note_block.harp" at volume 1 at pitch 0.5 to player
                # Daha yoğun duman efekti
                spawn 50 of smoke at location 1 meter above player with speed 0.1
                stop

            # Güvenli lokasyon bulma
            set {_loc1} to spawn of world {@world}
            set {_loc2} to spawn of world {@world}
            set y-coord of {_loc1} to 0
            set y-coord of {_loc2} to 0
            add {@area} to {_loc1}'s x-coord
            add {@area} to {_loc1}'s z-coord
            remove {@area} from {_loc2}'s x-coord
            remove {@area} from {_loc2}'s z-coord
            set {_loc} to getRandomLocation({_loc1}, {_loc2})

            while isSafeToTeleport({_loc}) isn't true:
                add 1 to y-coord of {_loc}
                if y-coord of {_loc} > 200: # Sunucu yüksekliğine göre (örn: 256) değiştirebilirsin
                    set {_loc} to getRandomLocation({_loc1}, {_loc2})
                    
            
            send title "&6Işınlanıyorsunuz..." with subtitle "&e3" to player for 1 second
            play sound "block.note_block.harp" at volume 1 at pitch 1 to player
            wait 1 second

            send title "&6Işınlanıyorsunuz..." with subtitle "&e2" to player for 1 second
            play sound "block.note_block.harp" at volume 1 at pitch 1 to player
            wait 1 second

            send title "&6Işınlanıyorsunuz..." with subtitle "&e1" to player for 1 second
            play sound "block.note_block.harp" at volume 1 at pitch 1 to player
            wait 1 second

            # --- Işınlanma Anı ---
            
            teleport player to {_loc}
            send title "&aIşınlandınız!" with subtitle "&7Güvenli bir bölgeye gönderildin." to player for 3 seconds
            play sound "block.enderman.teleport" at volume 1 at pitch 1 to player
            # Yoğun duman efekti
            spawn 50 of smoke at location 1 meter above player with speed 0.1
            # --- BİTİŞ ---

        else:
            send "&cBu dünyada bu komutu kullanamazsın." to player
            play sound "block.note_block.bass" at volume 1 at pitch 0.5 to player
            

on quit:
    if world of player is {@world}:
        set {lastLocation::%player%} to location of player

on teleport:
    if world of past event-location is {@world}:
        set {lastLocation::%player%} to past event-location


local function getRandomLocation(loc1: location, loc2: location) :: location:

    set {_randomX} to random number between x-coord of {_loc1} and x-coord of {_loc2}
    set {_randomZ} to random number between z-coord of {_loc1} and z-coord of {_loc2}

    set {_loc} to location(0,0,0, world of {_loc1})

    set x-coord of {_loc} to {_randomX}
    set y-coord of {_loc} to 0
    set z-coord of {_loc} to {_randomZ}


    return {_loc}


local function isSafeToTeleport(loc: location) :: boolean:

    set {_blockabove} to {_loc}
    add 1 to y-coord of {_blockabove}

    set {_block2above} to {_loc}
    add 2 to y-coord of {_block2above}

    if (block at {_loc}) or (block at {_blockabove}) or (block at {_block2above}) is solid:
        return false

    if block under {_loc} is {@blacklistedUnderBlocks}:
        return false

    if block under {_loc} isn't solid:
        return false

    return true

Bunu dener misiniz sunucumda daha denemedim işe gideceğim için.
 
teşekkürler skripti denedim fakat
Kod:
> sk reload all
[21:02:45 INFO]: [Skript] Reloading the config, aliases and all scripts...
[21:02:45 INFO]: [Skript] Loaded 5330 aliases in 238ms
[21:02:45 INFO]: Line 16: (magelol.sk)
[21:02:45 INFO]:     Can't understand this condition/effect: spawn 50 of smoke at location 1 meter above player with speed 0.1
[21:02:45 INFO]:     Line: spawn 50 of smoke at location 1 meter above player with speed 0.1
[21:02:45 INFO]:
[21:02:45 INFO]: Line 54: (magelol.sk)
[21:02:45 INFO]:     Can't understand this condition/effect: spawn 50 of smoke at location 1 meter above player with speed 0.1
[21:02:45 INFO]:     Line: spawn 50 of smoke at location 1 meter above player with speed 0.1
[21:02:45 INFO]:
[21:02:45 INFO]:     Encountered 2 errors while reloading the config, aliases and all scripts! (721ms)
hatası aldım ve ilk defa ışınlansa dahi evine dönülüyor yazıyor ve 3 saniyelik bekle olmuyor ışınlanırken ekranda yazılar gözükmüyor tekrardan teşekkür ederim @Zyph0rr ilgilenebilir misin rica etsem kolaylık olsun diye log kayıtı da atıyorum belki yardımcı olur
Değerli ziyaretçimiz, içeriği görebilmek için şimdi giriş yapın veya kayıt olun.
 
Magelol.sk kaptan skriptinin oldugu yer mi?

Kod:
Options:
    world: "world" # buraya dünya ismi gir, dünyaışınlan komutu girildiğinde bu dünyaya atacak.
    area: 300 # 300x300'lük bir alanda lokasyon bulacak.
    blacklistedUnderBlocks: lava or water or air # seçilen lokasyonun altında istenilmeyen bloklar.


command /dunyaisinlan:
    trigger:
        if world of player isn't {@world}:
            if {lastLocation::%player%} is set:
                # Geri dönüş ışınlanması
                teleport player to {lastLocation::%player%}
                send title "&aEvine Dönülüyor!" with subtitle "&7Önceki konumuna ışınlandın." to player for 3 seconds
                play sound "block.note_block.harp" at volume 1 at pitch 0.5 to player
              
                play "large smoke" at 1 meter above player count 50 speed 0.1 offset vector(0.3, 0.3, 0.3)
                stop

            # Güvenli lokasyon bulma
            set {_loc1} to spawn of world {@world}
            set {_loc2} to spawn of world {@world}
            set y-coord of {_loc1} to 0
            set y-coord of {_loc2} to 0
            add {@area} to {_loc1}'s x-coord
            add {@area} to {_loc1}'s z-coord
            remove {@area} from {_loc2}'s x-coord
            remove {@area} from {_loc2}'s z-coord
            set {_loc} to getRandomLocation({_loc1}, {_loc2})

            while isSafeToTeleport({_loc}) isn't true:
                add 1 to y-coord of {_loc}
                if y-coord of {_loc} > 200: # Sunucu yüksekliğine göre (örn: 256) değiştirebilirsin
                    set {_loc} to getRandomLocation({_loc1}, {_loc2})
                    
            
          
            
            send title "&6Işınlanıyorsunuz..." with subtitle "&e3" to player for 1 second
            play sound "block.note_block.harp" at volume 1 at pitch 1 to player
            wait 1 second

            send title "&6Işınlanıyorsunuz..." with subtitle "&e2" to player for 1 second
            play sound "block.note_block.harp" at volume 1 at pitch 1 to player
            wait 1 second

            send title "&6Işınlanıyorsunuz..." with subtitle "&e1" to player for 1 second
            play sound "block.note_block.harp" at volume 1 at pitch 1 to player
            wait 1 second

          
            
            teleport player to {_loc}
            send title "&aIşınlandınız!" with subtitle "&7Güvenli bir bölgeye gönderildin." to player for 3 seconds
            play sound "block.enderman.teleport" at volume 1 at pitch 1 to player
  
            play "large smoke" at 1 meter above player count 50 speed 0.1 offset vector(0.3, 0.3, 0.3)
          

        else:
            send "&cBu dünyada bu komutu kullanamazsın." to player
            play sound "block.note_block.bass" at volume 1 at pitch 0.5 to player
            

on quit:
    if world of player is {@world}:
        set {lastLocation::%player%} to location of player

on teleport:
    if world of past event-location is {@world}:
        set {lastLocation::%player%} to past event-location


local function getRandomLocation(loc1: location, loc2: location) :: location:

    set {_randomX} to random number between x-coord of {_loc1} and x-coord of {_loc2}
    set {_randomZ} to random number between z-coord of {_loc1} and z-coord of {_loc2}

    set {_loc} to location(0,0,0, world of {_loc1})

    set x-coord of {_loc} to {_randomX}
    set y-coord of {_loc} to 0
    set z-coord of {_loc} to {_randomZ}


    return {_loc}


local function isSafeToTeleport(loc: location) :: boolean:

    set {_blockabove} to {_loc}
    add 1 to y-coord of {_blockabove}

    set {_block2above} to {_loc}
    add 2 to y-coord of {_block2above}

    if (block at {_loc}) or (block at {_blockabove}) or (block at {_block2above}) is solid:
        return false

    if block under {_loc} is {@blacklistedUnderBlocks}:
        return false

    if block under {_loc} isn't solid:
        return false

    return true

Bunu deneyin.
 
Kod:
> sk reload all
[07:03:13 INFO]: [Skript] Reloading the config, aliases and all scripts...
[07:03:13 INFO]: [Skript] Loaded 5330 aliases in 347ms
[07:03:14 INFO]: Line 16: (magelol.sk)
[07:03:14 INFO]:     Functions cannot be used here (or there is a problem with your arguments).
[07:03:14 INFO]:     Line: play "large smoke" at 1 meter above player count 50 speed 0.1 offset vector(0.3, 0.3, 0.3)
[07:03:14 INFO]:
[07:03:14 INFO]: Line 56: (magelol.sk)
[07:03:14 INFO]:     Functions cannot be used here (or there is a problem with your arguments).
[07:03:14 INFO]:     Line: play "large smoke" at 1 meter above player count 50 speed 0.1 offset vector(0.3, 0.3, 0.3)
[07:03:14 INFO]:
[07:03:14 INFO]:     Encountered 2 errors while reloading the config, aliases and all scripts! (1265ms)
hata verdi yine :/ magelol.sk kaptan skriptinin olduğu yer her şeyden önemli zamanını bana harcadığın için tekrardan teşekkür ederim ışınlanırken saymıyor 3 den geriye ve anında ışınlanıyor ve sunucuya ilk defa giren oyuncuda evine dönülüyor yazıyor @Zyph0rr
 
Son düzenleme:
Buysun müsaitim.
Hocam en son verdiğiniz skrip te hata verdi yardım edebilir misin rica etsem @Zyph0rr
Kod:
> sk reload all
[07:03:13 INFO]: [Skript] Reloading the config, aliases and all scripts...
[07:03:13 INFO]: [Skript] Loaded 5330 aliases in 347ms
[07:03:14 INFO]: Line 16: (magelol.sk)
[07:03:14 INFO]:     Functions cannot be used here (or there is a problem with your arguments).
[07:03:14 INFO]:     Line: play "large smoke" at 1 meter above player count 50 speed 0.1 offset vector(0.3, 0.3, 0.3)
[07:03:14 INFO]:
[07:03:14 INFO]: Line 56: (magelol.sk)
[07:03:14 INFO]:     Functions cannot be used here (or there is a problem with your arguments).
[07:03:14 INFO]:     Line: play "large smoke" at 1 meter above player count 50 speed 0.1 offset vector(0.3, 0.3, 0.3)
[07:03:14 INFO]:
[07:03:14 INFO]:     Encountered 2 errors while reloading the config, aliases and all scripts! (1265ms)
hata verdi yine :/ magelol.sk kaptan skriptinin olduğu yer her şeyden önemli zamanını bana harcadığın için tekrardan teşekkür ederim ışınlanırken saymıyor 3 den geriye ve anında ışınlanıyor ve sunucuya ilk defa giren oyuncuda evine dönülüyor yazıyor @Zyph0rr
 
biraz kafa yordum ve skripti istediğim şekilde bitirdim sorunsuz çalışıyor ilgilendiğin için teşekkürler @Zyph0rr konu kapanabilir
 
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