Skript Paylaşımı Basit Vanish/Gizlenme Skript'i - /gizlen

Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...

yunanmadenci

Eküidistans
Katılım
28 Şubat 2022
Mesajlar
871
Elmaslar
378
Puan
7.580
Yaş
20
Konum
Samos, Yunanistan
Minecraft
yunanmadenci

Discord:

maadenci

Selamlar değerli dostlarım, geçen gün arkadaşlarla bir sunucu kurduk, oynarken biraz arkadaşlarla şakalaşmak istedim ve Essentials tarzı eklentilerin bizlere sunduğu, gizlenmemizi sağlayan "vanish" komutunu kullandım. Lakin bu özelliğin çok basit olduğunu ve yeterince uğraşılmamış olduğunu gördüm. Özellik size sadece görünmezlik etkisi veriyor, peki bakalım benim yazdığım Skript'in ne farklılıkları var.

Kodun denendiği sunucu sürümü: 1.21.4 Purpur
Gerekli eklentiler: Skript, PlaceholderAPI, skript-placeholders, skript-reflect
Kodun denendiği esnada sunucuda bulunan eklentiler:

1740340610987.webp



/gizlen komutunu kullanan yetkili, oyundaki komutlardan, oyunculardan ve her türlü canlıdan gizlenir.



/gizlen komutuyla gizlenen yetkili, canlılar tarafından tespit edilemez, kendisine canlılar tarafından bakılamaz. (Bu şekilde canlılar size bakamayacaklarından yanınızdaki oyuncular sizin varlığınızı anlayamaz)



/gizlen komutuyla gizlenen yetkililer birbirilerini etraflarında sizin seçeceğiniz renkli bir şerit ve renkli bir isimle görürler. (Not: OP dahi olsanız eğer gizlen modunda değilseniz gizli oyuncuları göremez, mesajlarını okuyamazsınız.)



Az önce de bahsettiğim renk özelliğini /gizlen menü komutuyla renk menüsü üzerinden oyun içerisinde anlık olarak değiştirebilirsiniz. (Not: gizlen yetkisine sahip olan yetkililer bu menüyü kullanamazlar, gizlen.menü yetkisine sahip olanlar menüye erişebilir.



Gizlen menüsündeki ittirme ayarını değiştirerek gizli moddaki oyuncuların canlıları veya diğer oyuncuları ittirebilme veya içinden geçebilme özelliğini değiştirebilirsiniz. Bu özellik sayesinde özellikle parkur haritalarında gizli moddayken oyuncuların içinden geçerek kendinizi belli etmemiş ve onları da aşağıya ittirmemiş olursunuz. (Not: Bu ayar sadece gizli modda olan oyuncular için geçerli ve oyun içerisinde istediğiniz an değiştirilebilir.)



Gizlen menüsündeki sohbet özelliğini kullanarak gizlenmiş oyuncuların yazı yazarken sadece kendi aralarında konuşabilmelerini sağlar. (Not: Bu özellik açıkken OP olsanız dahi gizli modda değilseniz gizlenmiş oyuncuların mesajlarını göremezsiniz.)



Gizlen menüsündeki bildirimler özelliğini açarak gizlendiğinizde oyunculara oyundan çıktığınızı, gizlen modundan çıktığınızda ise oyuna geri döndüğünüzü gösteren mesajlar gösterebilirsiniz. (DİKKAT: Bu özellik gizlileri sunucu oyuncularından da eksiltir, lakin eğer bunu oyun içinde göstermek istiyorsanız -örneğin videodaki gibi scoreboard'da oyuncu sayısı düşüyor- bu kodla eklenen %gizlen_oyuncular% placeholder'ıyla yapmanız gerekiyor. Yani kısacası kullandığınız scoreboard plugininde veya kullandığınız /list komutunda oyuncuların gözüktüğü kısımdaki %player_count%'u %gizlen_oyuncular% olarak değiştirmelisiniz. -Tabii bu özelliği kullanmayacaksanız herhangi bir şey yapmanıza gerek yok, tatlılık olsun diye ekledim. :)- (Ayrıca bu özellik açıkken gizlen modunda oyundan çıktığınızda çıktığınızın mesajı oyunculara gözükmez, karışıklık olmasın dedim. :D)



Son özelliğimiz ise özellikle Essentials tarzı eklentilerin gizlenme komutunda nedense düşünülmemiş olan bir başarım aldığınızda gizli modda olsanız dahi bütün oyunculara mesaj gitmesi sorunu. Örneğin siz arkadaşınızı gizli modda şakalarken yanındaki bir creeper'ı öldürdünüz ve sohbete kabak gibi başarım mesajı gitti. Bu sorunu da düzelttim. :) (Not: Başarımlar diğer oyuncularda veya gizlen modunda olmayan oyuncularda gizlenmez, yani tamamen kapatmadım korkmayın. :D)



Not: Gizlen modundayken süt içtiğinizde görünmezlik etkiniz gitmez, zaten görünmemenizi sağlayan şey görünmezlik etkisi değil, o görüntü olsun diye ekledim ama yine de hata olmasın diye süt sorununu giderdim, eğer 10 etkiniz varsa ve kurtulmak istiyorsanız gizli moddayken süt içmekten korkmanıza gerek yok yani. :)


En üstteki satırlardan Skript'in mesajlarını değiştirebilir kendinize göre özelleştirebilirsiniz, takılın kodun içinde keyfinize bakın.


Kod:


JavaScript:
options:
    ön ek: &8[&6Gizlen&8]
    ana yetki: gizlen
    menü yetkisi: gizlen.menü
    yetkin yok: {@ön ek} &7Bu komutu kullanmak için &eyetkin yok&8.

    oyuna giriş mesajı: &e%player% oyuna katıldı
    oyundan çıkış mesajı: &e%player% oyundan ayrıldı
join:
    set join message to "{@oyuna giriş mesajı}" if player's metadata "GIZLEN" != 1
    set join message to "" if player's metadata "GIZLEN" = 1
quit:
    set quit message to "{@oyundan çıkış mesajı}" if player's metadata "GIZLEN" = 1
    set quit message to "" if player's metadata "GIZLEN" = 1
consume of milk bucket:
    player's metadata "GIZLEN" = 1
    wait a tick
    apply infinite invisibility of tier 5 without any particles whilst hiding the potion icon to player
    stop
function gizlenmenüsü(p: player):
    set {_p}'s metadata "gizlen menüsü" to chest inventory with 3 rows named "Gizlen » Ana Menü"
    set {_} to {_p}'s metadata "gizlen menüsü"
    set slot numbers between 0 and 27 of {_} to black stained glass pane named "&f"
    set slot 10 of {_} to bookshelf named "&e&lʀᴇɴᴋ" with lore "&7Gizlenen oyuncuların &eisimlerinin&r%nl%&7ve onları çevreleyen &erengi &7değiştir&8.%nl%%nl%&7Aktif renk&8: &e%{gizlen::renk} in strict proper case otherwise "&6Altın"%"
    set slot 12 of {_} to chain named "&e&lɪᴛᴛɪʀᴍᴇ" with lore "&7Gizlenen oyuncuların canlıları &eittirebilmesini&r%nl%&7veya &eiçinden geçebilmelerini &7değiştirir&8.%nl%%nl%&7Aktif kural&8: &e%{gizlen::kural} otherwise "&eİçinden geçme"%"
    set slot 14 of {_} to string named "&e&lsᴏʜʙᴇᴛ" with lore "&7Aktifken gizlenen oyuncuların%nl%&7mesajları sadece diğer%nl%&7gizli oyunculara &eiletilir&8.%nl%%nl%&7Durum&8: &e%{gizlen::sohbet} in strict proper case otherwise "&eDevre dışı"%"
    set slot 16 of {_} to bell named "&e&lʙɪʟᴅɪʀɪᴍʟᴇʀ" with lore "&7Aktifken gizli moda geçen oyuncular%nl%&7sunucudaki üye sayısından &eeksilir&8,%nl%&7sohbete &eoyundan ayrıldı%nl%&7mesajı iletilir&8.%nl%%nl%&7Durum&8: &e%{gizlen::bildirimler} in strict proper case otherwise "&eDevre dışı"%"
    open {_} to {_p}
    stop
server list ping:
    hide players where [input's metadata "GIZLEN" = 1] from server list if {gizlen::bildirimler} = "aktif"
    stop
function gizlenmenüsürenk(p: player):
    set {_p}'s metadata "gizlen menüsü renk" to chest inventory with 3 rows named "Gizlen » Renk Menüsü"
    set {_} to {_p}'s metadata "gizlen menüsü renk"
    set slot numbers between 0 and 27 of {_} to black stained glass pane named "&f"
    set slot 10 of {_} to gray wool named "&8Gri" with lore "&7Seçmek için &etıkla&8!"
    set slot 11 of {_} to light blue wool named "&bAçık Mavi" with lore "&7Seçmek için &etıkla&8!"
    set slot 12 of {_} to red wool named "&cKırmızı" with lore "&7Seçmek için &etıkla&8!"
    set slot 13 of {_} to * wool named "&aYeşil" with lore "&7Seçmek için &etıkla&8!"
    set slot 14 of {_} to orange wool named "&6Altın" with lore "&7Seçmek için &etıkla&8!"
    set slot 15 of {_} to yellow wool named "&eSarı" with lore "&7Seçmek için &etıkla&8!"
    set slot 16 of {_} to purple wool named "&5Mor" with lore "&7Seçmek için &etıkla&8!"
    set slot 10 of {_} to gray wool of unbreaking with item flags hide enchants named "&8Gri" with lore "&7Zaten bu renk &eseçili&8." if {gizlen::renk} = "gri"
    set slot 11 of {_} to light blue wool of unbreaking with item flags hide enchants named "&bAçık Mavi" with lore "&7Zaten bu renk &eseçili&8." if {gizlen::renk} = "açık mavi"
    set slot 12 of {_} to red wool of unbreaking with item flags hide enchants named "&cKırmızı" with lore "&7Zaten bu renk &eseçili&8." if {gizlen::renk} = "kırmızı"
    set slot 13 of {_} to * wool of unbreaking with item flags hide enchants named "&aYeşil" with lore "&7Zaten bu renk &eseçili&8." if {gizlen::renk} = "yeşil"
    set slot 14 of {_} to orange wool of unbreaking with item flags hide enchants named "&6Altın" with lore "&7Zaten bu renk &eseçili&8." if {gizlen::renk} = "altın"
    set slot 15 of {_} to yellow wool of unbreaking with item flags hide enchants named "&eSarı" with lore "&7Zaten bu renk &eseçili&8." if {gizlen::renk} = "sarı"
    set slot 16 of {_} to purple wool of unbreaking with item flags hide enchants named "&5Mor" with lore "&7Zaten bu renk &eseçili&8." if {gizlen::renk} = "mor"
    open {_} to {_p}
    stop
inventory close:
    event-inventory = player's metadata "gizlen menüsü renk"
    wait a tick
    gizlenmenüsü(player)
    play sound "block.chest.close" with volume 1 to player
    stop
inventory click:
    event-inventory = player's metadata "gizlen menüsü":
        cancel event
        play sound "block.note_block.xylophone" with volume 1 to player if event-slot is 10 or 12 or 14 or 16
        index of event-slot = 16:
            {gizlen::bildirimler} isn't set:
                set {gizlen::bildirimler} to "aktif"
                set slot 16 of player's metadata "gizlen menüsü" to bell named "&e&lʙɪʟᴅɪʀɪᴍʟᴇʀ" with lore "&7Aktifken gizli moda geçen oyuncular%nl%&7sunucudaki üye sayısından &eeksilir&8,%nl%&7sohbete &eoyundan ayrıldı%nl%&7mesajı iletilir&8.%nl%%nl%&7Durum&8: &e%{gizlen::bildirimler} in strict proper case otherwise "&eDevre dışı"%"
                stop
            {gizlen::bildirimler} = "aktif":
                delete {gizlen::bildirimler}
                set slot 16 of player's metadata "gizlen menüsü" to bell named "&e&lʙɪʟᴅɪʀɪᴍʟᴇʀ" with lore "&7Aktifken gizli moda geçen oyuncular%nl%&7sunucudaki üye sayısından &eeksilir&8,%nl%&7sohbete &eoyundan ayrıldı%nl%&7mesajı iletilir&8.%nl%%nl%&7Durum&8: &e%{gizlen::bildirimler} in strict proper case otherwise "&eDevre dışı"%"
                stop
        index of event-slot = 14:
            {gizlen::sohbet} isn't set:
                set {gizlen::sohbet} to "aktif"
                set slot 14 of player's metadata "gizlen menüsü" to string named "&e&lsᴏʜʙᴇᴛ" with lore "&7Aktifken gizlenen oyuncuların%nl%&7mesajları sadece diğer%nl%&7gizli oyunculara &eiletilir&8.%nl%%nl%&7Durum&8: &e%{gizlen::sohbet} in strict proper case otherwise "&eDevre dışı"%"
                stop
            {gizlen::sohbet} = "aktif":
                delete {gizlen::sohbet}
                set slot 14 of player's metadata "gizlen menüsü" to string named "&e&lsᴏʜʙᴇᴛ" with lore "&7Aktifken gizlenen oyuncuların%nl%&7mesajları sadece diğer%nl%&7gizli oyunculara &eiletilir&8.%nl%%nl%&7Durum&8: &e%{gizlen::sohbet} in strict proper case otherwise "&eDevre dışı"%"
                stop
        index of event-slot isn't 10 or 12 or 14 or 16:
            play sound "block.note_block.bass" with volume 1 to player
            stop
        index of event-slot = 10:
            gizlenmenüsürenk(player)
            stop
        index of event-slot = 12:
            {gizlen::kural} isn't set:
                set {gizlen::kural} to "İttirme"
                console command "team modify gizlen collisionRule always"
                set slot 12 of player's metadata "gizlen menüsü" to chain named "&e&lɪᴛᴛɪʀᴍᴇ" with lore "&7Gizlenen oyuncuların canlıları &eittirebilmesini&r%nl%&7veya &eiçinden geçebilmelerini &7değiştirir&8.%nl%%nl%&7Aktif kural&8: &e%{gizlen::kural}%"
                stop
            {gizlen::kural} = "İttirme":
                delete {gizlen::kural}
                set slot 12 of player's metadata "gizlen menüsü" to chain named "&e&lɪᴛᴛɪʀᴍᴇ" with lore "&7Gizlenen oyuncuların canlıları &eittirebilmesini&r%nl%&7veya &eiçinden geçebilmelerini &7değiştirir&8.%nl%%nl%&7Aktif kural&8: &e%{gizlen::kural} otherwise "&eİçinden geçme"%"
                console command "team modify gizlen collisionRule never"
                stop
        stop
    event-inventory = player's metadata "gizlen menüsü renk":
        cancel event
        play sound "block.note_block.pling" if "%event-slot's item flags%" = "hide enchants"
        index of event-slot isn't 10 or 11 or 12 or 13 or 14 or 15 or 16:
            play sound "block.note_block.bass" with volume 1 to player
            stop
        else:
            "%event-slot's item flags%" != "hide enchants"
            play sound "block.note_block.chime"
            set {gizlen::renk} to lowercase uncoloured name of event-slot
            gizlenmenüsürenk(player)
            console command "team modify gizlen color dark_gray" if {gizlen::renk} = "gri"
            console command "team modify gizlen color aqua" if {gizlen::renk} = "açık mavi"
            console command "team modify gizlen color red" if {gizlen::renk} = "kırmızı"
            console command "team modify gizlen color green" if {gizlen::renk} = "yeşil"
            console command "team modify gizlen color gold" if {gizlen::renk} = "altın"
            console command "team modify gizlen color yellow" if {gizlen::renk} = "sarı"
            console command "team modify gizlen color dark_purple" if {gizlen::renk} = "mor"
        stop
    stop
placeholderapi placeholder with prefix "gizlen":
    identifier is "oyuncular"
    set {_a} to size of players where [input's metadata "GIZLEN" = 1]
    set result to player count - {_a} if {gizlen::bildirimler} = "aktif"
    set result to player count if {gizlen::bildirimler} isn't set
import:
    org.bukkit.event.player.PlayerAdvancementDoneEvent as Advancement
Advancement:
    set {_a} to event.getPlayer()
    {_a}'s metadata "GIZLEN" = 1
    set gamerule announceAdvancements of worlds to false
    gizlengamerule()
    stop
function gizlengamerule():
    wait 10 ticks
    set gamerule announceAdvancements of worlds to true
    stop
load:
    console command "gamerule sendCommandFeedback false"
    console command "team remove gizlen"
    console command "team add gizlen"
    console command "team modify gizlen deathMessageVisibility never"
    console command "team modify gizlen seeFriendlyInvisibles true"
    console command "team modify gizlen color gold" if {gizlen::renk} isn't set
    console command "team modify gizlen color dark_gray" if {gizlen::renk} = "gri"
    console command "team modify gizlen color aqua" if {gizlen::renk} = "açık mavi"
    console command "team modify gizlen color red" if {gizlen::renk} = "kırmızı"
    console command "team modify gizlen color green" if {gizlen::renk} = "yeşil"
    console command "team modify gizlen color gold" if {gizlen::renk} = "altın"
    console command "team modify gizlen color yellow" if {gizlen::renk} = "sarı"
    console command "team modify gizlen color dark_purple" if {gizlen::renk} = "mor"
    delete players' metadata "GIZLEN"
    reveal players from all players
    reveal players from all entities
    console command "team leave %players%"
    stop
command gizlen [<text>]:
    permission: gizlen
    permission message: {@yetkin yok}
    executable by: players
    trigger:
        arg 1 is set:
            arg 1 = "menü":
                play sound "block.chest.open" with volume 1 to player
                gizlenmenüsü(player)
                stop
        arg 1 isn't set
        player's metadata "GIZLEN" isn't set:
            send "{@ön ek} &e%player% &egizli &7moda &egeçti&8." to players where [input's metadata "GIZLEN" = 1]
            set player's metadata "GIZLEN" to 1
            set glowing of player to true
            send "{@oyundan çıkış mesajı}" to players if {gizlen::bildirimler} = "aktif"
            console command "team join gizlen %player%"
            hide player from all entities where [input's metadata "GIZLEN" != 1]
            reveal all players where [input's metadata "GIZLEN" = 1] from player
            apply infinite invisibility of tier 5 without any particles whilst hiding the potion icon to player
            send "{@ön ek} &7Bütün &eoyunculara &7ve &ecanlılara &egizlendin&8!" to player
            play sound "block.note_block.pling" with volume 0.5 to player
            stop
        player's metadata "GIZLEN" = 1:
            delete player's metadata "GIZLEN"
            remove invisibility from player
            send "{@oyuna giriş mesajı}" to players if {gizlen::bildirimler} = "aktif"
            set glowing of player to false
            send "{@ön ek} &e%player% &egizli &7moddan &eçıktı&8." to players where [input's metadata "GIZLEN" = 1]
            console command "team leave %player%"
            reveal player from all entities
            play sound "block.note_block.didgeridoo" with volume 0.5 to player
            hide all entities where [input's metadata "GIZLEN" = 1] from player
            send "{@ön ek} &7Gizliliğin &ekaldırıldı&8, &7artık bütün oyuncular seni &egörebilir&8." to player
            stop
target:
    target is a player
    cancel event if target's metadata "GIZLEN" = 1
    stop
damage of player:
    cancel event if victim's metadata "GIZLEN" = 1
    stop
chat:
    player's metadata "GIZLEN" = 1
    player has permission "gizlen"
    {gizlen::sohbet} = "aktif"
    cancel event
    send "{@ön ek} &e%player%&8: &7%coloured message%" to players where [input's metadata "GIZLEN" = 1]
    stop
 
Skript yerine plugin yazabilirseniz güzel olabilir. Elinize sağlık.
Tabii optimizasyon konusunda haklısınız elbet, lakin bu tip özellikler oyun içerisinde çok önemli olmadıkları için plugin ağırlığında değil de Skript gibi saniyesinde oyuna eklenip çıkartılabilen özellikler olmaları benim için daha hoş duruyor. Çünkü plugin olarak eklense hem sunucuya ağırlık yapacak hem de plugin niteliği taşıyabilecek kadar özelliğinin olduğunu düşünmüyorum, yorumunuz için çok teşekkür ederim, saygılar.
 
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