0mustafa
Evet ilkte aldığın için. Koda bir komut eklemesi yapacağım onu kullanırsın.tamam ama ilk verdiğinde boxpvp dünyasına girdim ve 2 saatlik koruman aktif yazısı cıktı yeni verdiğini yaptım reload attım ole bir yazı cıkmadı ilkde aldığım içinmidir ?
0mustafa
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
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.
/boxpvpprotectionresetfirstjoin komutuyla sıfırlayabilirsin. (OP'lere özel olduğu için fazla kullanışlı bir isim seçmedim.)tamamdırArkadaşın verdiği çalışmazsa ben kendiminki düzeltip gönderirim burayı sürekli kodlarla doldurmak istemedim.
bu kodu nereye yüklücem kral bide oplara özelmi bu koruma ben op olmayanlarda kullansın istiyorum/boxpvpprotectionresetfirstjoin
kral bunumu yapıyım eskisini silip ? enson verdiğini silip bunumu koyuyumPython: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 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
Hayır bunu yapmamızın sebebi ilk katılımı yeniden simüle etmek. Yani sen bu komutu kullanıp tekrar boxPvP dünyasına gidersen ilk defa girmişsin gibi davranacak kod. Yani op olmayanların kesinlikle kullanmaması gereken bir komut.bu kodu nereye yüklücem kral bide oplara özelmi bu koruma ben op olmayanlarda kullansın istiyorum
tamamda verdiğin kodu nasıl yüklücem anlamadım o en son veridiğin skript kodunu yapsam oluyormu direk ?Hayır bunu yapmamızın sebebi ilk katılımı yeniden simüle etmek. Yani sen bu komutu kullanıp tekrar boxPvP dünyasına gidersen ilk defa girmişsin gibi davranacak kod. Yani op olmayanların kesinlikle kullanmaması gereken bir komut.
0mustafa
"Kodu yükle"den kastım kodu .sk dosyana yapıştır ve /sk reload <dosyaismi> yap.tamamda verdiğin kodu nasıl yüklücem anlamadım o en son veridiğin skript kodunu yapsam oluyormu direk ?
tamamdır yapıyorum hemenHer şeyi silip son attığım kodu yerleştir.
EN son verdiğin skripti yaptım oluyor demi reloadda attim"Kodu yükle"den kastım kodu .sk dosyana yapıştır ve /sk reload <dosyaismi> yap.
Büyük bir topluluğun parçası ol, etkinliklere katıl ve özel hediyeler kazanma şansı yakala!