duel bıtınce lobıye atsın 2 sınıde
📎
1 file
8,679 chars
📄
pasted-code-1790869280616.txt
txt
204 lines
▶
pasted-code-1790869280616.txt
txt
204 lines
options:
ArenaBolgesi: "pvparenasi" # WorldGuard bölge adı
ArenaDunyasi: "world-restore-ymvi0mng" # Arenanın olduğu dünyanın tam adı
LobiDunyasi: "world-restore-ymvi0mng" # Lobi dünyasının tam adı
# --- 1. ŞIK VE MODERN 1V1 SWORD MENÜSÜ ---
command /1v1:
trigger:
set {_gui} to a new chest inventory with 3 rows named "&8&l⚔ &b&lSword 1V1 Arena Menüsü &8&l⚔"
loop integers between 0 and 26:
set slot loop-value of {_gui} to gray stained glass pane named "&7"
# Slot 11: Bilgi / Kurallar (Kitap)
set slot 11 of {_gui} to written book named "&e&l⚔ Sword 1V1 Rehberi" with lore "&7• Sıraya girerek otomatik rakip bulabilirsin.", "&7• Eşleşince 3 saniye donup geri sayım başlar.", "&7• /duello [isim] yazarak arkadaşına meydan okuyabilirsin."
# Slot 13: Sıraya Gir / Ayrıl Butonu
if {1v1.sirada.%player%} is true:
set slot 13 of {_gui} to red wool named "&c&lSıradan Ayrıl" with lore "&8➥ Durum: &cSırada Bekleniyor...", "", "&eTıklayarak sıradan çıkabilirsin!"
else:
set slot 13 of {_gui} to netherite sword named "&a&lSıra Kuyruğuna Gir" with lore "&8➥ Durum: &7Boşta", "", "&eTıklayarak Sword 1V1 sırasına katıl!"
open {_gui} to player
# --- 2. MENÜ TIKLAMA VE KESİN EŞLEŞTİRME ---
on inventory click:
if name of player's current inventory is "&8&l⚔ &b&lSword 1V1 Arena Menüsü &8&l⚔":
cancel event
if index of event-slot is 13:
close player's inventory
if {1v1.sirada.%player%} is true:
set {1v1.sirada.%player%} to false
if {1v1.bekleyen} is player:
delete {1v1.bekleyen}
send "&c[1v1] &fSıradan ayrıldın." to player
else:
if {1v1.bekleyen} is not set:
set {1v1.bekleyen} to player
set {1v1.sirada.%player%} to true
send "&a[1v1] &fSword 1V1 sırasına katıldın! Rakip bekleniyor..." to player
else if {1v1.bekleyen} is set:
set {_rakip} to {1v1.bekleyen}
if {_rakip} is player:
send "&cZaten sıradasın, bir rakip bekleniyor!" to player
stop
delete {1v1.bekleyen}
set {1v1.sirada.%{_rakip}%} to false
set {1v1.sirada.%player%} to false
baslatDuello({_rakip}, player)
# --- 3. DÜELLO BAŞLATMA, KİT VERME VE GARANTİ KİLİTLEME ---
function baslatDuello(p1: player, p2: player):
set {arenada.mi.%{_p1}%} to true
set {arenada.mi.%{_p2}%} to true
set {donuyor.mu.%{_p1}%} to true
set {donuyor.mu.%{_p2}%} to true
set {_arenaDunya} to "{@ArenaDunyasi}" parsed as world
if {_arenaDunya} is not set:
set {_arenaDunya} to world "world"
# 90 derece sola bakan konumlar
set {_loc1} to location(240.5, 69, -61.5, {_arenaDunya}, -90, 0)
set {_loc2} to location(265.5, 69, -61.5, {_arenaDunya}, 90, 0)
teleport {_p1} to {_loc1}
teleport {_p2} to {_loc2}
# Kitleri Ver
verKit({_p1})
verKit({_p2})
# Eşleşme Bildirimi
send title "&b&lEşleşme Bulundu!" with subtitle "&eRakip: %{_p2}%" to {_p1} for 2 seconds
send title "&b&lEşleşme Bulundu!" with subtitle "&eRakip: %{_p1}%" to {_p2} for 2 seconds
wait 1 second
# 3 Saniye Geri Sayım ve Konuma Sabitleme
teleport {_p1} to {_loc1}
teleport {_p2} to {_loc2}
send title "&c&l3" with subtitle "&eSancı hazırlanıyor..." to {_p1} for 1.2 seconds
send title "&c&l3" with subtitle "&eSancı hazırlanıyor..." to {_p2} for 1.2 seconds
play sound "block.note_block.pling" with volume 1 and pitch 1 to {_p1}, {_p2}
wait 1 second
teleport {_p1} to {_loc1}
teleport {_p2} to {_loc2}
send title "&e&l2" with subtitle "&eHazır ol!" to {_p1} for 1.2 seconds
send title "&e&l2" with subtitle "&eHazır ol!" to {_p2} for 1.2 seconds
play sound "block.note_block.pling" with volume 1 and pitch 1 to {_p1}, {_p2}
wait 1 second
teleport {_p1} to {_loc1}
teleport {_p2} to {_loc2}
send title "&a&l1" with subtitle "&eKılıcını çek!" to {_p1} for 1.2 seconds
send title "&a&l1" with subtitle "&eKılıcını çek!" to {_p2} for 1.2 seconds
play sound "block.note_block.pling" with volume 1 and pitch 1 to {_p1}, {_p2}
wait 1 second
# Donmayı kaldır
delete {donuyor.mu.%{_p1}%}
delete {donuyor.mu.%{_p2}%}
send title "&2&lBAŞLA!" with subtitle "&fKılıcını konuştur!" to {_p1} for 1.5 seconds
send title "&2&lBAŞLA!" with subtitle "&fKılıcını konuştur!" to {_p2} for 1.5 seconds
play sound "entity.player.levelup" with volume 1 and pitch 1 to {_p1}, {_p2}
# --- 4. KİT OLUŞTURMA FONKSİYONU ---
function verKit(p: player):
clear {_p}'s inventory
heal {_p}
set {_p}'s food level to 20
# Zırhlar (Kırılmazlık 3, ikisi Koruma 4, ikisi Koruma 3)
set {_kask} to diamond helmet
enchant {_kask} with unbreaking 3
enchant {_kask} with protection 4
set {_p}'s helmet to {_kask}
set {_gogus} to diamond chestplate
enchant {_gogus} with unbreaking 3
enchant {_gogus} with protection 4
set {_p}'s chestplate to {_gogus}
set {_pantolon} to diamond leggings
enchant {_pantolon} with unbreaking 3
enchant {_pantolon} with protection 3
set {_p}'s leggings to {_pantolon}
set {_bot} to diamond boots
enchant {_bot} with unbreaking 3
enchant {_bot} with protection 3
set {_p}'s boots to {_bot}
# Kılıçlar (Kırılmazlık 3)
set {_elmaskilic} to diamond sword
enchant {_elmaskilic} with unbreaking 3
give {_elmaskilic} to {_p}
set {_tahtakilic} to wooden sword
enchant {_tahtakilic} with unbreaking 3
give {_tahtakilic} to {_p}
# --- 5. HAREKET KONTROLÜ ---
on move:
if {donuyor.mu.%player%} is true:
cancel event
# --- 6. YASAKLI KOMUTLAR VE EŞYA KORUMASI ---
on command:
if {arenada.mi.%player%} is true:
set {_cmd} to command
if {_cmd} contains "rtp" or "rtpgui" or "pvp" or "shop" or "order" or "ah" or "sell" or "sellall" or "arenaayril" or "spawn" or "home" or "warp":
cancel event
send "&c[Arena] &fDüellodayken bu komutu kullanamazsın! Rakibini yenmek zorundasın." to player
on drop:
if {arenada.mi.%player%} is true:
cancel event
send "&c[Arena] &fDüello sırasında eşya atamazsın!" to player
# --- 7. 1V1 DÜELLO SİSTEMİ (Arkadaşa İstek) ---
command /duello []:
trigger:
if arg-1 is set:
if arg-1 is player:
send "&cKendine düello atamazsın!" to player
stop
set {duello.istek.%arg-1%} to player
send "&a[Düello] &e%player% &fsana Sword düellosu isteği gönderdi! Kabul etmek için &e/duellokabul" to arg-1
send "&a[Düello] &e%arg-1% &fadlı oyuncuya düello isteği gönderildi." to player
else:
send "&cDüello atmak istediğin oyuncunun adını yazmalısın: /duello [isim]" to player
command /duellokabul:
trigger:
set {_rakip} to {duello.istek.%player%}
if {_rakip} is set:
set {1v1.sirada.%player%} to false
set {1v1.sirada.%{_rakip}%} to false
if {1v1.bekleyen} is player:
delete {1v1.bekleyen}
if {1v1.bekleyen} is {_rakip}:
delete {1v1.bekleyen}
delete {duello.istek.%player%}
baslatDuello(player, {_rakip})
else:
send "&cSana gelen bekleyen bir düello isteği yok." to player
# --- 8. ÖLÜM VE ARENADA KALMA KONTROLÜ ---
on death of player:
if player is within region "{@ArenaBolgesi}" or {arenada.mi.%player%} is true:
clear drops
set death message to "&c[Arena] &e%player% &fsword düellosunda katledildi!"
heal player
set player's food level to 20
set {arenada.mi.%player%} to false
set {1v1.sirada.%player%} to false
if {1v1.bekleyen} is player:
delete {1v1.bekleyen}
delete {donuyor.mu.%player%}
clear player's inventory
set {_lobiDunya} to "{@LobiDunyasi}" parsed as world
if {_lobiDunya} is not set:
set {_lobiDunya} to world "world"
teleport player to location(0, 64, 0, {_lobiDunya})
send "&c[Arena] &fDüelloyu kaybettin ve lobiye döndün!" to player
KodariOct 1 at 3:42 pm 1
DuelLobbyReturn
DuelLobbyReturn is a Bukkit plugin that manages 1v1 sword duel arenas with automatic lobby return. It features a modern GUI menu system for queueing, kit distribution with enchanted diamond armor and swords, a 3-second freeze countdown before battle, movement and command restrictions during matches, and friend duel requests. When a player dies in the arena, the plugin clears drops, resets their inventory, heals them, and teleports both duel participants back to the configured lobby world at a safe spawn location. The plugin ensures both players are returned to the lobby after the duel concludes, providing a seamless arena experience.
Düello başlarken rakipleri kaydet; oyunculardan biri ölünce kazananı da lobiye gönder.
baslatDuello fonksiyonunda, arenada değişkenlerini ayarladığın yere ekle:
Skript
set {duello.rakip.%{_p1}%} to {_p2}
set {duello.rakip.%{_p2}%} to {_p1}
on death of player bölümünde, lobi dünyasını belirleyip kaybedeni ışınladığın kısma şu rakip işlemlerini ekle:
Skript
set {_rakip} to {duello.rakip.%player%}
delete {duello.rakip.%player%}
if {_rakip} is set:
delete {duello.rakip.%{_rakip}%}
set {arenada.mi.%{_rakip}%} to false
set {1v1.sirada.%{_rakip}%} to false
delete {donuyor.mu.%{_rakip}%}
if {_rakip} is online:
clear {_rakip}'s inventory
heal {_rakip}
set {_rakip}'s food level to 20
teleport {_rakip} to location(0, 64, 0, {_lobiDunya})
send "&a[Arena] &fRakibini yendin ve lobiye döndün!" to {_rakip}
Mevcut teleport player to location(...) satırı da ölen oyuncuyu lobiye gönderir; bu ekleme rakibini de gönderir.
Kodari can make mistakes. Review important code before using.
Files
No files in this session
Code