Solved Need Help {in a hurry}

  • 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.

melanzy

Member
Aug 4, 2021
11
0
1
23
Skript Version: 2.2-dev36 Minecraft Version: 1.8.9

Code
Code:
command /revive [<offlineplayer>]:
  aliases: rev
  trigger:
   if player has permission "events.moderator":
     if arg-1 is a player:
       make console execute command "scoreboard teams join Dead %arg-1%"
       make console execute command "scoreboard teams join Alive %arg-1%"
       make console execute command "effect %arg-1% clear"
       wait 1 second
       teleport arg-1 to {events_spawn}
       wait 2 ticks
       broadcast "{@prefix} &f%arg-1% &ahas been revived!"
     if {teamcount::*} doesn't contain arg-1:
       add arg-1 to {teamcount::*}
       stop


What doesn't work
Code:
 if {teamcount::*} doesn't contain arg-1:
   add arg-1 to {teamcount::*}
   stop


I want to make so if i issue the command twice, if the player is already in the list, it doesn't add him back again

no errors: console + ingame

Boosting
 
Last edited:
Im not sure if the condition will work, but i think u need to put "else if"

Try

Code:
else if {teamcount::*} doesn't contain arg-1:
   add arg-1 to {teamcount::*}
   stop
 
Im not sure if the condition will work, but i think u need to put "else if"

Try

Code:
else if {teamcount::*} doesn't contain arg-1:
   add arg-1 to {teamcount::*}
   stop
Nop


But I don't really get what are you trying to do? Please provide a proper description.
And this check is useless, it just adds the player and then stops.
Code:
     if {teamcount::*} doesn't contain arg-1:
       add arg-1 to {teamcount::*}
       stop
 
Nop


But I don't really get what are you trying to do? Please provide a proper description.
And this check is useless, it just adds the player and then stops.
Code:
     if {teamcount::*} doesn't contain arg-1:
       add arg-1 to {teamcount::*}
       stop
I am trying to prevent adding the player twice, if i do the command it checks if he's already in {teamcount::*}, and if he is it doesn't add him again, else if he isn't it does add him
 
Switched to discord - Solution:
Code:
command /revive [<offlineplayer>]:
    aliases: rev
    trigger:
        if player has permission "events.moderator":
            if arg-1 is a player:
                if "%{teamcount::*}%" contains "%arg-1%"
                    add arg-1 to {teamcount::*}
                    make console execute command "scoreboard teams join Dead %arg-1%"
                    make console execute command "scoreboard teams join Alive %arg-1%"
                    make console execute command "effect %arg-1% clear"
                    teleport arg-1 to {events_spawn}
                    broadcast "{@prefix} &f%arg-1% &ahas been revived!"
 
Status
Not open for further replies.