Solved Help me

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

MyNameIsBond

New Member
Sep 19, 2018
9
0
0
19
At the beginning of a minigame, everyone gets a list and at the end of the game only one person is left in a list. I like to put it into a separate variable.
How could this be? Can anyone help me?


#Google translator
 
This?
code_language.skript:
command /start:
    trigger:
        set {players::*} to all players
    
on death:
    {players::*} contains victim
    remove victim from {players::*}
    size of {players::*} = 1
    set {_p} to "%{players::*}%" parsed as a offline player
    broadcast "%{_p}% won"
    
on disconnect:
    {players::*} contains player
    remove player from {players::*}
    size of {players::*} = 1
    set {_p} to "%{players::*}%" parsed as a offline player
    broadcast "%{_p}% won"
 
This?
code_language.skript:
command /start:
    trigger:
        set {players::*} to all players
  
on death:
    {players::*} contains victim
    remove victim from {players::*}
    size of {players::*} = 1
    set {_p} to "%{players::*}%" parsed as a offline player
    broadcast "%{_p}% won"
  
on disconnect:
    {players::*} contains player
    remove player from {players::*}
    size of {players::*} = 1
    set {_p} to "%{players::*}%" parsed as a offline player
    broadcast "%{_p}% won"
[doublepost=1537533773,1537533743][/doublepost]Thank you very much :emoji_slight_smile:
[doublepost=1537535713][/doublepost]This contains does not work. He does not make an error, but when 2 players are in the list and killing each other nothing happens. It does not say who won it. Should I have some addons?

#google translate
 
What version of Skript are you using? (you don't need addons)
 
I'm using this code:

code_language.skript:
command /start:
    trigger:
        set {players::*} to all players
            
on death:
    {players::*} contains victim
    remove victim from {players::*}
    size of {players::*} = 1
    set {_p} to "%{players::*}%" parsed as a offline player
    broadcast "%{_p}% won"
            
command /check:
    trigger:
        send "%{players::*}%"
 
Can you try sending the variable when after the remove code (after line 7) ran? Just so I can see if it actually removed the victim
 
Like this:

code_language.skript:
command /start:
    trigger:
        set {players::*} to all players
            
on death:
    {players::*} contains victim
    send "%victim%"
    remove victim from {players::*}
    size of {players::*} = 1
    set {_p} to "%{players::*}%" parsed as a offline player
    broadcast "%{_p}% won"
            
command /check:
    trigger:
        send "%{players::*}%"
 
Like this:

code_language.skript:
command /start:
    trigger:
        set {players::*} to all players
          
on death:
    {players::*} contains victim
    send "%victim%"
    remove victim from {players::*}
    size of {players::*} = 1
    set {_p} to "%{players::*}%" parsed as a offline player
    broadcast "%{_p}% won"
          
command /check:
    trigger:
        send "%{players::*}%"
More like this:
code_language.skript:
command /start:
    trigger:
        set {players::*} to all players
         
on death:
    broadcast "1: %{players::*}% (%victim%)"
    if {players::*} contains victim:
        remove victim from {players::*}
        size of {players::*} = 1
        set {_p} to "%{players::*}%" parsed as a offline player
        broadcast "%{_p}% won"
    broadcast "2: %{players::*}% (%victim%)"
         
command /check:
    trigger:
        send "%{players::*}%"
send me what it outputs when you kill someone
 
Okay can you try this code for me?
code_language.skript:
command /start:
    trigger:
        set {players::*} to all players
        
on death:
    broadcast "1: %{players::*}% (%victim%)"
    remove victim from {players::*}
    if size of {players::*} = 1:
        set {_p} to "%{players::*}%" parsed as a offline player
        broadcast "%{_p}% won"
    broadcast "2: %{players::*}% (%victim%)"
        
command /check:
    trigger:
        send "%{players::*}%"
 
Status
Not open for further replies.