Balance Teams

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

Leonardo_

Member
Sep 21, 2020
18
0
1
24
Hi, I would need help to fix this command. I need him to be able to block entry into a team with more people than the others. I did this, but it doesn't work. (He doesn't tell me any errors)

Code:
command /joinitaly:
    permission: ww2.selectteam
    trigger:
        if {russia} or {usa} or {germania} are higher than {italia}:
            set {italia_lista::*} to "%player%"
            add 1 to {italia}
            message "{@prefix} Ora sei in Italia!" to player
        if {russia},{usa} and {germania} are equal to {italia}:
            set {italia_lista::*} to "%player%"
            add 1 to {italia}
            message "{@prefix} Ora sei in Italia!" to player



command /resetall:
    permission: ww2.debug.resetall
    trigger:
        delete {russia_lista::*}
        delete {italia_lista::*}
        delete {germania_lista::*}
        delete {usa_lista::*}
        delete {mercenario_lista::*}
        set {italia} to 0
        set {russia} to 0
        set {usa} to 0
 
Hi, I would need help to fix this command. I need him to be able to block entry into a team with more people than the others. I did this, but it doesn't work. (He doesn't tell me any errors)

Code:
command /joinitaly:
    permission: ww2.selectteam
    trigger:
        if {russia} or {usa} or {germania} are higher than {italia}:
            set {italia_lista::*} to "%player%"
            add 1 to {italia}
            message "{@prefix} Ora sei in Italia!" to player
        if {russia},{usa} and {germania} are equal to {italia}:
            set {italia_lista::*} to "%player%"
            add 1 to {italia}
            message "{@prefix} Ora sei in Italia!" to player



command /resetall:
    permission: ww2.debug.resetall
    trigger:
        delete {russia_lista::*}
        delete {italia_lista::*}
        delete {germania_lista::*}
        delete {usa_lista::*}
        delete {mercenario_lista::*}
        set {italia} to 0
        set {russia} to 0
        set {usa} to 0

I tried your skript and all it said was you didn't make the options. you need to add the "prefix" option.



Code:
options:
    prefix: (whatever your prefix is)

(this goes above the skript, or that's normal how people do it.)
 
I tried your skript and all it said was you didn't make the options. you need to add the "prefix" option.



Code:
options:
    prefix: (whatever your prefix is)

(this goes above the skript, or that's normal how people do it.)
{@prefix} I had already set it, only I hadn't copied it to the script excerpt. The problem is that it doesn't recognize whether variables are equal to or higher than another
[doublepost=1607886376,1607848596][/doublepost]Help please
 
Hi, I would need help to fix this command. I need him to be able to block entry into a team with more people than the others. I did this, but it doesn't work. (He doesn't tell me any errors)

Code:
command /joinitaly:
    permission: ww2.selectteam
    trigger:
        if {russia} or {usa} or {germania} are higher than {italia}:
            set {italia_lista::*} to "%player%"
            add 1 to {italia}
            message "{@prefix} Ora sei in Italia!" to player
        if {russia},{usa} and {germania} are equal to {italia}:
            set {italia_lista::*} to "%player%"
            add 1 to {italia}
            message "{@prefix} Ora sei in Italia!" to player



command /resetall:
    permission: ww2.debug.resetall
    trigger:
        delete {russia_lista::*}
        delete {italia_lista::*}
        delete {germania_lista::*}
        delete {usa_lista::*}
        delete {mercenario_lista::*}
        set {italia} to 0
        set {russia} to 0
        set {usa} to 0

This doesnt let you choose a team, but it should make it as even as posible
Code:
command /jointeam:
  trigger:
    if {team1} or {team3} or {team4} is more than {team2}:
      send "You joined the USA!" to player
      add 1 to {team2}
      add player to {team2.usa}
    if {team2} or {team3} or {team4} is more than {team1}:
      add player to {team1.italy}
      add 1 to {team1}
      send "You joined Italy!" to player
    if {team2} or {team1} or {team4} is more than {team3}:
      send "You joined Russia" to player
      add player to {team3.russia}
      add 1 to {team3}
    if {team2} or {team1} or {team3} is more than {team4}:
      send "You joined Germany!" to player
      add player to {team4.germany}
      add 1 to {team4}


command /teamsreset:
  permission: skript.resetteams
  trigger:
    clear {team4}
    clear {team3}
    clear {team2}
    clear {team1}
    clear {team4.germany}
    clear {team3.russia}
    clear {team2.usa}
    clear {team2.italy}
    send "All teams were cleared!" to player
 
Status
Not open for further replies.