1. 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!


    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

team eco

Discussion in 'Skript' started by Hartvig, Jul 4, 2017.

Thread Status:
Not open for further replies.
  1. Hartvig

    Hartvig Member

    Apr 18, 2017
    Likes Received:
    So i'm working on a team skript, and i've made a team eco system, but i have a problem, i can deposit to the team balance, i can see how much the team have on their balance, but i can't take from a balance, the "/teamfarvesæt" command will change the team color, and i would like to make it cost 50 from the team's balance.

    Code (Skript):
    1. command /teamfarvesæt [<text>]:
    2.     trigger:
    3.         if arg 1 is not set:
    4.             stop
    5.         if arg 1 is "f":
    6.             if {team.owner.%{team.%player%}%} is player:
    7.                 subtract 50 from {team.eco.%{team.%player%}%}
    8.                 set {team.farve.%{team.%player%}%} to "&f"
    9.         if arg 1 is "4":
    10.             if {team.owner.%{team.%player%}%} is player:
    11.                 subtract 50 from {team.eco.%{team.%player%}%}
    12.                 set {team.farve.%{team.%player%}%} to "&4"
    13.         if arg 1 is "2":
    14.             if {team.owner.%{team.%player%}%} is player:
    15.                 subtract 50 from {team.eco.%{team.%player%}%}
    16.                 set {team.farve.%{team.%player%}%} to "&2"
    17.         if arg 1 is "5":
    18.             if {team.owner.%{team.%player%}%} is player:
    19.                 subtract 50 from {team.eco.%{team.%player%}%}
    20.                 set {team.farve.%{team.%player%}%} to "&5"
    21.         if arg 1 is "1":
    22.             if {team.owner.%{team.%player%}%} is player:
    23.                 subtract 50 from {team.eco.%{team.%player%}%}
    24.                 set {team.farve.%{team.%player%}%} to "&1"
    25. command /team [<text>] [<text>] [<text>]:
    26.         if arg 1 is "penge":
    27.             if {team.%player%} is set:
    28.                 send " "
    29.                 send "&7Dit team har %{team.farve.%{team.%player%}%}%%{team.eco%{team.%player%}%}% &aKroner &7på dens konto"
    30.                 send " "
    31.         if arg 1 is "deposit":
    32.             if {team.%player%} is set:
    33.                 if player's balance is greater than arg 2 parsed as a integer -1:
    34.                     subtract arg 2 parsed as a integer from player's balance
    35.                     add arg 2 parsed as a integer to {team.eco%{team.%player%}%}
    36.                     send " "
    37.                     send "&7Du overførte %{team.farve.%{team.%player%}%}%%arg 2% &akroner &7til dit team"
    38.                     send " "
    39.                     send "&a%player% &7Overførte %{team.farve.%{team.%player%}%}%%arg 2% &aKroner &7til teamet" to {team.owner.%{team.%player%}%}
    40.                 else:
    41.                     send "&cDu har ikke penge nok"
    42.             else:
    43.                 send "&cDu skal være en del af et team"
    --- Double Post Merged, Jul 5, 2017, Original Post Date: Jul 4, 2017 ---
  2. ShaneBee

    Supporter + Addon Developer

    Sep 7, 2017
    Likes Received:
    Okay, so I got this to work for me in a much more simplified test version. I can only think it must be another variable you have causing the issue? Here is the test I have it removes and adds to the balance variable just fine and disallows the transaction if the test owner variable is not set. "subtract" works just as well as "remove".

    Edit: For me the "is player" versus "is equal to "%player%" also seems to be irrelevant and works just fine either way

    command /baltest <text> [<number>]:
    if {test.bal} is not set:
    set {test.bal} to 0
    if arg 1 is equal to "add":
    if {team.owner.%player%} is equal to "%player%":
    add arg 2 to {test.bal}
    send "%arg-2% added to test balance"
    if arg 1 is equal to "del":
    if {team.owner.%player%} is equal to "%player%":
    remove arg 2 from {test.bal}
    send "%arg-2% removed from test balance"
    if arg 1 is equal to "list":
    send "%{test.bal}%"

    command /grouptest <text> <player>:
    if arg 1 is equal to "promote":
    set {team.owner.%player%} to player
    send "%player% is now test owner"
    if arg 1 is equal to "demote":
    delete {team.owner.%player%}
    send "group owner test variable removed"
Thread Status:
Not open for further replies.

Share This Page