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...

Erenslslsl

Zombi Geldi, Beni Yedi
Katılım
28 Ocak 2025
Mesajlar
252
Elmaslar
28
Puan
805
Yaş
16
Konum
muğla
Merhaba Arkadaşlar Ben şunu istiyorum oyuncu boxpvp dünyasına girdiğinde ona savaş koruması verilmesini istiyorum yani oyuna ilk giridiğinde ona 2 saat boyunca kimse vuramıcak pvpin açık olduğu yerlerde bile ve bu verdiğimiz korumayı /korumakapat komudu sayesinde korumasını isterse açabilcek bunun için bir skript lazım
 
Merhaba Arkadaşlar Ben şunu istiyorum oyuncu boxpvp dünyasına girdiğinde ona savaş koruması verilmesini istiyorum yani oyuna ilk giridiğinde ona 2 saat boyunca kimse vuramıcak pvpin açık olduğu yerlerde bile ve bu verdiğimiz korumayı /korumakapat komudu sayesinde korumasını isterse açabilcek bunun için bir skript lazım
20-30 dakikaya atarım.
 
Merhaba Arkadaşlar Ben şunu istiyorum oyuncu boxpvp dünyasına girdiğinde ona savaş koruması verilmesini istiyorum yani oyuna ilk giridiğinde ona 2 saat boyunca kimse vuramıcak pvpin açık olduğu yerlerde bile ve bu verdiğimiz korumayı /korumakapat komudu sayesinde korumasını isterse açabilcek bunun için bir skript lazım
Kod:
on first join:
    if world of player is "boxpvp":
        set {pvpprotection.%player%} to true
        send "&7Savaş korumanız aktif! 2 saat boyunca kimse sizi vuramaz." to player
        run task 120 * 60 seconds in 1 tick:
            set {pvpprotection.%player%} to false
            send "&7Savaş korumanız sona erdi. Artık PvP'ye açıksınız." to player

command /korumakapat:
    permission: pvpprotection.bypass
    trigger:
        if {pvpprotection.%player%} is true:
            set {pvpprotection.%player%} to false
            send "&7Savaş korumanız kapatıldı. Artık PvP'ye açıksınız." to player
        else:
            send "&7Zaten savaş korumanız kapalı." to player

on damage:
    if {pvpprotection.%victim%} is true:
        cancel event
        send "&7Savaş korumanız aktif olduğu için size vurulamaz!" to attacker
Bunu deneyebilirsiniz.
 
deniyorum hemen
 
Merhaba Arkadaşlar Ben şunu istiyorum oyuncu boxpvp dünyasına girdiğinde ona savaş koruması verilmesini istiyorum yani oyuna ilk giridiğinde ona 2 saat boyunca kimse vuramıcak pvpin açık olduğu yerlerde bile ve bu verdiğimiz korumayı /korumakapat komudu sayesinde korumasını isterse açabilcek bunun için bir skript lazım
Korumayı geri aktif edebileceği bir komut ister misin?
 
kral line 5 de hata verio "run task 120 * 60 seconds in 1 tick:" şu kısımda hata verio
 
kral line 5 de hata verio "run task 120 * 60 seconds in 1 tick:" şu kısımda hata verio
Python:
options:
    protectionDuration: 720 # 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 3 seconds

            set {_t} to {@protectionDuration} / 60

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


on damage:
    if victim is a player:
        if attacker is a player:
            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 "&cKoruman 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



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 10 second # lag çıkmasın diye 10, bunu düşürebilirsin istersen.

Bunu deneyebilirsin. Henüz test etmedim, hataları paylaşırsın.
 
Python:
options:
    protectionDuration: 720 # 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 3 seconds

            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 {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 "&cKoruman 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



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.

Bir hata varmış onu düzelttim. Öncekisini kullanma bunu kullan.
 
KR
Python:
options:
    protectionDuration: 720 # 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 3 seconds

            set {_t} to {@protectionDuration} / 60

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


on damage:
    if victim is a player:
        if attacker is a player:
            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 "&cKoruman 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



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 10 second # lag çıkmasın diye 10, bunu düşürebilirsin istersen.

Bunu deneyebilirsin. Henüz test etmedim, hataları paylaşırsın
kral ilk verdiğinde çalıştı galiba test etmem gerek ama hata vermedi yenisinide denicem hemen
 
KR

kral ilk verdiğinde çalıştı galiba test etmem gerek ama hata vermedi yenisinide denicem hemen
öncekisinde wait a second ifadesini unutmuşum. Koruma aldığın gibi yaklaşık 5-10 saniye bekleyip sunucunu çökertecekti/koruma anında bitecekti.
 
kral line 5 de hata verio "run task 120 * 60 seconds in 1 tick:" şu kısımda hata verio
Arkadaşın verdiği çalışmazsa ben kendiminki düzeltip gönderirim burayı sürekli kodlarla doldurmak istemedim.
 
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