Menü
💬 Forum 🛒 Mağaza ⛏️ Sunucular ⚔️ Klanlar 📰 Blog 🏆 Liderlik 👥 Üyeler 🎖️ Rütbeler
1 üye online 👥 12 toplam üye 📝 Bugün 31 konu 💬 Bugün 33 mesaj

Skript ile Oyunluk Sistem — Mini Oyun Kodlama Rehberi

orginscorel · 1 saat önce · 1 gönderi · 0 görüntülenme
#1

Skript ile Mini Oyun Sistemi Yazma — Sıfırdan Oyun Geliştirme



Skript, Minecraft sunucularına Java yazmadan yeni özellikler eklemenin en erişilebilir yolu. Bu rehberde basit ama işlevsel bir mini oyun sistemi oluşturuyoruz.

Oyun Durumu Yönetimi




on load:
set {oyun.durum} to "bekleme"
set {oyun.min-oyuncu} to 2
set {oyun.max-oyuncu} to 8

function oyunBaslat():
set {oyun.durum} to "sayim"
broadcast "&eOyun &a10 &esaniye içinde başlıyor!"
loop 10 times:
wait 1 second
subtract 1 from {oyun.sayac}
if {oyun.sayac} <= 5:
broadcast "&c%{oyun.sayac}%..."
set {oyun.durum} to "oyun"
broadcast "&aOYUN BAŞLADI!"


Oyuncu Kayıt Sistemi




command /katil:
trigger:
if {oyun.durum} is "bekleme":
if {oyun.oyuncular::*} contains player:
send "&cZaten kayıtlısınız!"
stop
add player to {oyun.oyuncular::*}
send "&aOyuna katıldınız!"
broadcast "&7%player% katıldı. (%size of {oyun.oyuncular::*}%/%{oyun.max-oyuncu}%)"
if size of {oyun.oyuncular::*} >= {oyun.min-oyuncu}:
oyunBaslat()
else:
send "&cŞu an kayıt kabul edilmiyor."


Ölüm ve Kazanan Sistemi




on death of player:
if {oyun.durum} is "oyun":
if {oyun.oyuncular::*} contains victim:
remove victim from {oyun.oyuncular::*}
broadcast "&c%victim% elendi! (&a%size of {oyun.oyuncular::*}% kaldı)"
if size of {oyun.oyuncular::*} <= 1:
set {oyun.kazanan} to first element of {oyun.oyuncular::*}
oyunBit()

function oyunBit():
broadcast "&6&lOYUN BİTTİ! Kazanan: &e%{oyun.kazanan}%"
give {oyun.kazanan} 5 diamond
wait 5 seconds
clear {oyun.oyuncular::*}
set {oyun.durum} to "bekleme"
broadcast "&7Yeni oyun bekleniyor..."


Skor Sistemi




on death of player:
if attacker is a player:
add 1 to {skor.kill::%attacker%}
add 10 to {skor.puan::%attacker%}
send "&a+10 puan!" to attacker

command /skor:
trigger:
send "&6Kill: &a%{skor.kill::%player%}%"
send "&6Puan: &e%{skor.puan::%player%}%"


Ekip Sistemi




function ekipAta(p: player):
set {_min} to 999
loop {ekipler::*}:
set {_sayi} to size of {ekip.%loop-value%::*}
if {_sayi} < {_min}:
set {_min} to {_sayi}
set {_secilen} to loop-value
add arg-1 to {ekip.%{_secilen}%::*}
send "&aEkibiniz: &r%{_secilen}%" to arg-1


Skript mini oyun geliştirme hakkında sorularınız için bu konuya yazın!

Cevap yazabilmek için giriş yap.