0mustafa
/korumaver 5 yaptım gene herkeze vurabiliyorum kral olmadı
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.
0mustafa
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.
0mustafa
Tamamdır, bu arada her attığımda worldName seçeneğini kendine göre değiştirmen gerekiyordu, umarım yapmışsındır :Dkral sunucu kapandı açılsın sana dönüş yapcam hemen
0mustafa
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.kral calışıyor herşeyi denedim korumakapati falan cok iyi olmuş ellerine sağlık çok teşekkürler
Büyük bir topluluğun parçası ol, etkinliklere katıl ve özel hediyeler kazanma şansı yakala!