team eco

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

Hartvig

Member
Apr 18, 2017
39
1
0
22
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_language.skript:
command /teamfarvesæt [<text>]:
    trigger:
        if arg 1 is not set:
            stop
        if arg 1 is "f":
            if {team.owner.%{team.%player%}%} is player:
                subtract 50 from {team.eco.%{team.%player%}%}
                set {team.farve.%{team.%player%}%} to "&f"
        if arg 1 is "4":
            if {team.owner.%{team.%player%}%} is player:
                subtract 50 from {team.eco.%{team.%player%}%}
                set {team.farve.%{team.%player%}%} to "&4"
        if arg 1 is "2":
            if {team.owner.%{team.%player%}%} is player:
                subtract 50 from {team.eco.%{team.%player%}%}
                set {team.farve.%{team.%player%}%} to "&2"
        if arg 1 is "5":
            if {team.owner.%{team.%player%}%} is player:
                subtract 50 from {team.eco.%{team.%player%}%}
                set {team.farve.%{team.%player%}%} to "&5"
        if arg 1 is "1":
            if {team.owner.%{team.%player%}%} is player:
                subtract 50 from {team.eco.%{team.%player%}%}
                set {team.farve.%{team.%player%}%} to "&1"
command /team [<text>] [<text>] [<text>]:
        if arg 1 is "penge":
            if {team.%player%} is set:
                send " "
                send "&7Dit team har %{team.farve.%{team.%player%}%}%%{team.eco%{team.%player%}%}% &aKroner &7på dens konto"
                send " "
        if arg 1 is "deposit":
            if {team.%player%} is set:
                if player's balance is greater than arg 2 parsed as a integer -1:
                    subtract arg 2 parsed as a integer from player's balance
                    add arg 2 parsed as a integer to {team.eco%{team.%player%}%}
                    send " "
                    send "&7Du overførte %{team.farve.%{team.%player%}%}%%arg 2% &akroner &7til dit team"
                    send " "
                    send "&a%player% &7Overførte %{team.farve.%{team.%player%}%}%%arg 2% &aKroner &7til teamet" to {team.owner.%{team.%player%}%}
                else:
                    send "&cDu har ikke penge nok"
            else:
                send "&cDu skal være en del af et team"
[doublepost=1499277953,1499194271][/doublepost]bump
 
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>]:
trigger:
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"
stop
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"
stop
if arg 1 is equal to "list":
send "%{test.bal}%"
stop

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