SK Yardım

Thraenkost

Lapis Toplayıcısı
En iyi cevaplar
1
Beyler town of salem oynayanlar bilir demiştimde

şimdi benim amacım 15 kişiye farklı farklı roller verecek ama ben bunu yapamadım.
Bi bakar mısınız
Kod:
command /roles:
    trigger:
        loop players:
            add players to {players::*}
        chance of 11%:
            {tos.1} isn't set:
                set {tos.1} to a random element out of {players::*} # Sheriff
                send "sheriff" to {tos.1}
                remove {tos.1} from {players::*}
                stop
        chance of 11%:
            {tos.2} isn't set:
                set {tos.2} to a random element out of {players::*} # Investigator
                send "invest" to {tos.2}
                remove {tos.2} from {players::*}
                stop
        chance of 110%:
            {tos.3} isn't set:
                set {tos.3} to a random element out of {players::*} # Serial Killer
                send "Rolün: &1Serial Killer" to {tos.3}
                send " " to {tos.3}
                send "Rol Hakkında Açıklama: &7Sen bir seri katilsin. Her gece insanları bıçaklayıp öldürürsün. Kazanmak için herkesi öldür ve hayatta kal (Mafyalarda Dahil.)" to {tos.3}
                send " " to {tos.3}
                remove {tos.3} from {players::*}
                stop
        chance of 11%:
            {tos.4} isn't set:
                set {tos.4} to a random element out of {players::*} # Lookout
                send "lookout" to {tos.4}
                remove {tos.4} from {players::*}
                stop
        chance of 11%:
            {tos.5} isn't set:
                set {tos.5} to a random element out of {players::*} # Framer
                send "framer" to {tos.5}
                remove {tos.5} from {players::*}
                stop
        chance of 11%:
            {tos.6} isn't set:
                set {tos.6} to a random element out of {players::*} # Mafioso
                send "mafioso" to {tos.6}
                remove {tos.6} from {players::*}
                stop
        chance of 11%:
            {tos.7} isn't set:
                set {tos.7} to a random element out of {players::*} # Doctor
                send "doctor" to {tos.7}
                remove {tos.7} from {players::*}
                stop
        chance of 11%:
            {tos.8} isn't set:
                set {tos.8} to a random element out of {players::*} # Escort
                send "escort" to {tos.8}
                remove {tos.8} from {players::*}
                stop
        chance of 11%:
            {tos.9} isn't set:
                set {tos.9} to a random element out of {players::*} # Godfather
                send "godfather" to {tos.9}
                remove {tos.9} from {players::*}
                stop
        chance of 11%:
            {tos.10} isn't set:
                set {tos.10} to a random element out of {players::*} # Medium
                send "medium" to {tos.10}
                remove {tos.10} from {players::*}
                stop
        chance of 11%:
            {tos.11} isn't set:
                set {tos.11} to a random element out of {players::*} # Veteran or Vigilante
                chance of 50%:
                    send "vet" to {tos.11}
                chance of 50%:
                    send "vigi" to {tos.11}
                remove {tos.11} from {players::*}
                stop
        chance of 11%:
            {tos.12} isn't set:
                set {tos.12} to a random element out of {players::*} # Executioner
                send "executioner" to {tos.12}
                remove {tos.12} from {players::*}
                stop
        chance of 11%:
            {tos.13} isn't set:
                set {tos.13} to a random element out of {players::*} # Jailor
                send "sheriff" to {tos.13}
                remove {tos.13} from {players::*}
                stop
        chance of 11%:
            {tos.14} isn't set:
                set {tos.14} to a random element out of {players::*} # Investigator 2
                send "investigator" to {tos.14}
                remove {tos.14} from {players::*}
                stop
        chance of 11%:
            {tos.15} isn't set:
                set {tos.15} to a random element out of {players::*} # Jester
                send "jester" to {tos.15}
                remove {tos.15} from {players::*}
                stop

Şimdi sorunum şu. 15 kişiye rol vermesi gerek ama sadece bazı kişilere rol veriyor. Herkese vermiyor.
Bazıları rol alamıyor malesef direk boş kalıyorlar nasıl çözerim ?
 

IaReLeGenD

Marangoz
En iyi cevaplar
0
Çünkü Şöyle Yapman Gerekiyordu.
Denemedim, TAB Hataları Olabilir;

Kod:
command /roles:
    trigger:
        loop players:
            add players to {players::*}
        loop 25 times:
            wait 5 tick
            chance of 11%:
                {tos.1} isn't set:
                    set {tos.1} to a random element out of {players::*} # Sheriff
                    send "sheriff" to {tos.1}
                    remove {tos.1} from {players::*}
                    stop
            chance of 11%:
                {tos.2} isn't set:
                    set {tos.2} to a random element out of {players::*} # Investigator
                    send "invest" to {tos.2}
                    remove {tos.2} from {players::*}
                    stop
            chance of 11%:
                {tos.3} isn't set:
                    set {tos.3} to a random element out of {players::*} # Serial Killer
                    send "Rolün: &1Serial Killer" to {tos.3}
                    send " " to {tos.3}
                    send "Rol Hakkında Açıklama: &7Sen bir seri katilsin. Her gece insanları bıçaklayıp öldürürsün. Kazanmak için herkesi öldür ve hayatta kal (Mafyalarda Dahil.)" to {tos.3}
                    send " " to {tos.3}
                    remove {tos.3} from {players::*}
                    stop
            chance of 11%:
                {tos.4} isn't set:
                    set {tos.4} to a random element out of {players::*} # Lookout
                    send "lookout" to {tos.4}
                    remove {tos.4} from {players::*}
                    stop
            chance of 11%:
                {tos.5} isn't set:
                    set {tos.5} to a random element out of {players::*} # Framer
                    send "framer" to {tos.5}
                    remove {tos.5} from {players::*}
                    stop
            chance of 11%:
                {tos.6} isn't set:
                    set {tos.6} to a random element out of {players::*} # Mafioso
                    send "mafioso" to {tos.6}
                    remove {tos.6} from {players::*}
                    stop
            chance of 11%:
                {tos.7} isn't set:
                    set {tos.7} to a random element out of {players::*} # Doctor
                    send "doctor" to {tos.7}
                    remove {tos.7} from {players::*}
                    stop
            chance of 11%:
                {tos.8} isn't set:
                    set {tos.8} to a random element out of {players::*} # Escort
                    send "escort" to {tos.8}
                    remove {tos.8} from {players::*}
                    stop
            chance of 11%:
                {tos.9} isn't set:
                    set {tos.9} to a random element out of {players::*} # Godfather
                    send "godfather" to {tos.9}
                    remove {tos.9} from {players::*}
                    stop
            chance of 11%:
                {tos.10} isn't set:
                    set {tos.10} to a random element out of {players::*} # Medium
                    send "medium" to {tos.10}
                    remove {tos.10} from {players::*}
                    stop
            chance of 11%:
                {tos.11} isn't set:
                    set {tos.11} to a random element out of {players::*} # Veteran or Vigilante
                    chance of 50%:
                        send "vet" to {tos.11}
                    else:
                        send "vigi" to {tos.11}
                    remove {tos.11} from {players::*}
                    stop
            chance of 11%:
                {tos.12} isn't set:
                    set {tos.12} to a random element out of {players::*} # Executioner
                    send "executioner" to {tos.12}
                    remove {tos.12} from {players::*}
                    stop
            chance of 11%:
                {tos.13} isn't set:
                    set {tos.13} to a random element out of {players::*} # Jailor
                    send "sheriff" to {tos.13}
                    remove {tos.13} from {players::*}
                    stop
            chance of 11%:
                {tos.14} isn't set:
                    set {tos.14} to a random element out of {players::*} # Investigator 2
                    send "investigator" to {tos.14}
                    remove {tos.14} from {players::*}
                    stop
            chance of 11%:
                {tos.15} isn't set:
                    set {tos.15} to a random element out of {players::*} # Jester
                    send "jester" to {tos.15}
                    remove {tos.15} from {players::*}
                    stop
 
Son düzenleme:

Blueyescat

Bedrock Kaşifi
En iyi cevaplar
0
Anladığım kadarıyla bunu yaptım:
Kod:
loop 15 times:
    set {_allPlayers::*} to players
    set {_p} to random player of {_allPlayers::*}
    add {_p} to {_players::*}
    remove {_p} from {_allPlayers::*}
    if size of {_allPlayers::*} is 0:
        stop loop
loop "Sheriff", "Investigator", "Serial killer", "Lookout", "Framer", "Mafioso", "Doctor", "Escort", "Godfather", "Medium", "Veteran or Vigilante", "Executioner", "Jailor", "Investigator 2" and "Jester":
    add 1 to {_n}
    set {tos::%{_n}%} to {_players::%{_n}%}
  
    #Oyuncuya rolünü mesaj olarak gönderir
    if loop-value is "Veteran or Vigilante":
        send random element of "Veteran" and "Vigilante" to {_players::%{_n}%}
    else:
        send loop-value to {_players::%{_n}%}
{_players::*} listesine 15'den az oyuncu mesela 5 tane koyarsan ilk 5 rolü listedeki ilk 5'e verir.

Konu uzarsa forumdan konuşmayı sevmiyorum: https://forum.gamer.com.tr/konu/327935/
 
Son düzenleme:

Thraenkost

Lapis Toplayıcısı
En iyi cevaplar
1
Anladığım kadarıyla bunu yaptım:
Kod:
loop 15 times:
    set {_allPlayers::*} to players
    set {_p} to random player of {_allPlayers::*}
    add {_p} to {_players::*}
    remove {_p} from {_allPlayers::*}
    if size of {_allPlayers::*} is 0:
        stop loop
loop "Sheriff", "Investigator", "Serial killer", "Lookout", "Framer", "Mafioso", "Doctor", "Escort", "Godfather", "Medium", "Veteran or Vigilante", "Executioner", "Jailor", "Investigator 2" and "Jester":
    add 1 to {_n}
    set {tos::%{_n}%} to {_players::%{_n}%}
 
    #Oyuncuya rolünü mesaj olarak gönderir
    if loop-value is "Veteran or Vigilante":
        send random element of "Veteran" and "Vigilante" to {_players::%{_n}%}
    else:
        send loop-value to {_players::%{_n}%}
{_players::*} listesine 15'den az oyuncu mesela 5 tane koyarsan ilk 5 rolü listedeki ilk 5'e verir.

Konu uzarsa forumdan konuşmayı sevmiyorum: https://forum.gamer.com.tr/konu/327935/
Hocam saolun da ilk 5 rolü oyuncuya verirse oyuncular serial killer mafya arsonist gibilerini aa bu adam 4. sırada bu adam mafya diyerek asmaz mı ?
 

Blueyescat

Bedrock Kaşifi
En iyi cevaplar
0
Hocam saolun da ilk 5 rolü oyuncuya verirse oyuncular serial killer mafya arsonist gibilerini aa bu adam 4. sırada bu adam mafya diyerek asmaz mı ?
Tam olarak bu işine yaramalı:
Kod:
set {_allPlayers::*} to players
set {_allRoles::*} to "Sheriff", "Investigator", "Serial killer", "Lookout", "Framer", "Mafioso", "Doctor", "Escort", "Godfather", "Medium", "Veteran or Vigilante", "Executioner", "Jailor", "Investigator 2" and "Jester"
loop 15 times:
    if size of {_allPlayers::*} is greater than 0:
        set {_p} to random player of {_allPlayers::*}
        add {_p} to {_players::*}
        remove {_p} from {_allPlayers::*}
    set {_p} to random element of {_allRoles::*}
    add {_p} to {_roles::*}
    remove {_p} from {_allRoles::*}
loop {_roles::*}:
    add 1 to {_n}
    if {_players::%{_n}%} is set:
        set {tos::%{_n}%} to {_players::%{_n}%}
 
    if loop-value is "Veteran or Vigilante":
        send random element of "Veteran" and "Vigilante" to {_players::%{_n}%}
    else:
        send loop-value to {_players::%{_n}%}
En başta {_allPlayers::*} listesi işleme girecek oyuncuları belirler.

2 kere aynı kodu çalıştırınca:
 
Son düzenleme:

Thraenkost

Lapis Toplayıcısı
En iyi cevaplar
1
Tam olarak bu işine yaramalı:
Kod:
set {_allPlayers::*} to players
set {_allRoles::*} to "Sheriff", "Investigator", "Serial killer", "Lookout", "Framer", "Mafioso", "Doctor", "Escort", "Godfather", "Medium", "Veteran or Vigilante", "Executioner", "Jailor", "Investigator 2" and "Jester"
loop 15 times:
    if size of {_allPlayers::*} is greater than 0:
        set {_p} to random player of {_allPlayers::*}
        add {_p} to {_players::*}
        remove {_p} from {_allPlayers::*}
    set {_p} to random element of {_allRoles::*}
    add {_p} to {_roles::*}
    remove {_p} from {_allRoles::*}
loop {_roles::*}:
    add 1 to {_n}
    if {_players::%{_n}%} is set:
        set {tos::%{_n}%} to {_players::%{_n}%}
 
    if loop-value is "Veteran or Vigilante":
        send random element of "Veteran" and "Vigilante" to {_players::%{_n}%}
    else:
        send loop-value to {_players::%{_n}%}
En başta {_allPlayers::*} listesi işleme girecek oyuncuları belirler.

2 kere aynı kodu çalıştırınca:
Hocam ben bunu denemiştim yani oyuncuya 1 tane rol değil 3 4 tane rol geliyor.
 

Thraenkost

Lapis Toplayıcısı
En iyi cevaplar
1
Yanlış mesajı alıntıladın galiba? Benim kodda oyuncuyla alakalı bir şey yok :D resimde gördüğün gibi. Gerisi senin nasıl kullandığına bağlı...
1. attığın kodda yanlışlık vardı. Saol gökdeniz.

Benim Paylaştığım Kodu Kullanırsan Daha İyi Olur.
Şimdi Biraz Daha Düzenledim. Kod Zaten
Üst Kısımda Var. Tavsiyem Bu,.
Senin koduda kullandım bu sefer hçibir rol gelmiyor.
Gökdeniz yardımcı oldu teşekkürler.
 
Üst