Bulundu Oyuncu Belirli dünyaya girince ona koruma verme

  • Konuyu Başlatan Konuyu Başlatan Erenslslsl
  • Başlangıç tarihi Başlangıç tarihi
  • Görüntüleme 1.184
Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...
/korumaver 5 yaptım gene herkeze vurabiliyorum kral olmadı
 
/korumaver 5 yaptım gene herkeze vurabiliyorum kral olmadı
Python:
options:
    protectionDuration: 120 # dakika cinsinden
    worldName: "boxpvpdünyaismi" # dünya ismi

    protectionEndedMessage: "&cKoruman bitti! Artık diğer oyuncular sana saldırabilir."



on world change:
    if event-world is {@worldName}:
        if {boxpvp.playerProtectionLeft::%player%} isn't set:
            set {boxpvp.playerProtectionLeft::%player%} to 0

        if {boxpvp.firstJoinProtectionGiven::%player%} isn't set:
            set {boxpvp.firstJoinProtectionGiven::%player%} to true

            set {boxpvp.protection.protecting::%player%} to true
            set {boxpvp.playerProtectionLeft::%player%} to {@protectionDuration} * 60

            wait 0.5 second

            set {_t} to {@protectionDuration} / 60

            send "&a%{_t}% saat boyunca PvP'lere karşı korunacaksın!" to player


on damage:
    if victim is a player:
        if attacker is a player:
            if world of victim is {@worldName}:
                if {boxpvp.protection.protecting::%attacker%} is true:
                    cancel event
                    
                    send "&cPvP koruman olduğu için saldırı yapamazsın!" to attacker
                    play sound "minecraft:item.shield.break" to attacker


                else if {boxpvp.protection.protecting::%victim%} is true:
                    cancel event
                    
                    send "&cBu oyuncu saldırılara karşı korunuyor!" to attacker
                    play sound "minecraft:item.shield.break" to attacker


on join:
    protectionHandler(player)



command /korumakapat:
    trigger:
        if {boxpvp.protection.protecting::%player%} is true:
            set {boxpvp.protection.protecting::%player%} to false
            send "&aKoruman başarıyla devre dışı bırakıldı!" to player
            play sound "entity.player.levelup" to player
        else:
            send "&cKoruman zaten aktif değil!" to player
            play sound "block.note_block.bass" at pitch 0.5 to player


command /korumaver <int>:
    permission: boxpvp.protection.giveProtection
    trigger:
        loop all players:
            send loop-player to players
            add arg 1 to {boxpvp.playerProtectionLeft::%loop-player%}
            set {boxpvp.protection.protecting::%player%} to true


command /boxpvpprotectionresetfirstjoin:
    permission: op
    permission message: &cBu komuta iznin yok.
    trigger:
        delete {boxpvp.firstJoinProtectionGiven::%player%}




local function protectionHandler(p: player):
    while {_p} is online:
        while {boxpvp.protection.protecting::%{_p}%} is true:
            if {boxpvp.playerProtectionLeft::%{_p}%} > 0:
                remove 1 from {boxpvp.playerProtectionLeft::%{_p}%}

            else:
                set {boxpvp.protection.protecting::%{_p}%} to false
                send {@protectionEndedMessage} to {_p}

            wait a second

        wait 10 second # lag çıkmasın diye 10, bunu düşürebilirsin istersen.

Düzelttim.
 
kral sunucu kapandı açılsın sana dönüş yapcam hemen
 
Python:
options:
    protectionDuration: 120 # dakika cinsinden
    worldName: "boxpvpdünyaismi" # dünya ismi

    protectionEndedMessage: "&cKoruman bitti! Artık diğer oyuncular sana saldırabilir."



on world change:
    if event-world is {@worldName}:
        if {boxpvp.playerProtectionLeft::%player%} isn't set:
            set {boxpvp.playerProtectionLeft::%player%} to 0

        if {boxpvp.firstJoinProtectionGiven::%player%} isn't set:
            set {boxpvp.firstJoinProtectionGiven::%player%} to true

            set {boxpvp.protection.protecting::%player%} to true
            set {boxpvp.playerProtectionLeft::%player%} to {@protectionDuration} * 60

            wait 0.5 second

            set {_t} to {@protectionDuration} / 60

            send "&a%{_t}% saat boyunca PvP'lere karşı korunacaksın!" to player


on damage:
    if victim is a player:
        if attacker is a player:
            if world of victim is {@worldName}:
                if {boxpvp.protection.protecting::%attacker%} is true:
                    cancel event
                   
                    send "&cPvP koruman olduğu için saldırı yapamazsın!" to attacker
                    play sound "minecraft:item.shield.break" to attacker


                else if {boxpvp.protection.protecting::%victim%} is true:
                    cancel event
                   
                    send "&cBu oyuncu saldırılara karşı korunuyor!" to attacker
                    play sound "minecraft:item.shield.break" to attacker


on join:
    protectionHandler(player)



command /korumakapat:
    trigger:
        if {boxpvp.protection.protecting::%player%} is true:
            set {boxpvp.protection.protecting::%player%} to false
            send "&aKoruman başarıyla devre dışı bırakıldı!" to player
            play sound "entity.player.levelup" to player
        else:
            send "&cKoruman zaten aktif değil!" to player
            play sound "block.note_block.bass" at pitch 0.5 to player


command /korumaver <int>:
    permission: boxpvp.protection.giveProtection
    trigger:
        loop all players:
            send loop-player to players
            add arg 1 * 60 to {boxpvp.playerProtectionLeft::%loop-player%}
            set {boxpvp.protection.protecting::%player%} to true


command /boxpvpprotectionresetfirstjoin:
    permission: op
    permission message: &cBu komuta iznin yok.
    trigger:
        delete {boxpvp.firstJoinProtectionGiven::%player%}




local function protectionHandler(p: player):
    while {_p} is online:
        while {boxpvp.protection.protecting::%{_p}%} is true:
            if {boxpvp.playerProtectionLeft::%{_p}%} > 0:
                remove 1 from {boxpvp.playerProtectionLeft::%{_p}%}

            else:
                set {boxpvp.protection.protecting::%{_p}%} to false
                send {@protectionEndedMessage} to {_p}

            wait a second

        wait 10 second # lag çıkmasın diye 10, bunu düşürebilirsin istersen.

Bu daha stabil bir versiyonu.
 
worldname yazan yere dünyamın adımı yazıyorum yani

worldname: BoxPvP
 
sunucu acıldı yapıyorum şuan
 
KRAL girdim boxpvp dünyasına 2 saat boyunca pvplerden korunucaksın dedi
 
bizim arkadaşı cagırdım girsin denicez oldu gibi ama :D
 
kral calışıyor herşeyi denedim korumakapati falan cok iyi olmuş ellerine sağlık çok teşekkürler
 
kral calışıyor herşeyi denedim korumakapati falan cok iyi olmuş ellerine sağlık çok teşekkürler
Rica ederim, biraz basit kaldı normalde daha iyi yapardım fakat yorgunum biraz. Bir hata falan çıkarsa bana ulaşabilirsin :) Bir de konuyu Bulundu olarak işaretlemen güzel olur.

İyi forumlar.
 
tabiki tamamdır tekrardan teşekkürler
 
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