Jump to content

give arg-3 to (variable) to arg-2 (player arg)


BlahBlahh

Recommended Posts

also here is the code

 

command /tokens [<string>] [<player>] [<number>]:
  aliases: "/token"
  permission: "tokens.sk"
  trigger:
    if arg-1 is "give":
      give arg-3 to {tokens::%player%}
      send "&6Added %arg-3% to %arg-2%" to player

Link to comment
Share on other sites

15 minutes ago, BlahBlahh said:

also here is the code

 

command /tokens [<string>] [<player>] [<number>]:
  aliases: "/token"
  permission: "tokens.sk"
  trigger:
    if arg-1 is "give":
      give arg-3 to {tokens::%player%}
      send "&6Added %arg-3% to %arg-2%" to player

If you want to add a number to a variable use add

add arg 3 to {tokens::%player%}

As you see you also wrote player in your variable which is always the player that executes the command to change that use arg 2 here instead

add arg 3 to {tokens::%arg 2%}

Another thing is you're only using player or now arg 2 this means it will use their name. The issue is if they change their name all their progress is gone : (

add arg 3 to {tokens::%arg 2's uuid%}

That's why you should use uuid instead this stays forever

Here is a quick overview of how it looks for skript:

{tokens::%player%} -> {tokens::starbunnie}

{tokens::%player's uuid%} -> {tokens::aaaaaaaaaa-bbbbbb-cccc-dddd-eeeeee}

 

  • Like 2

tumblr_lqahoaPLkC1ql1l0v.gif

Feel free to add me on discord if you:

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need help with plugins

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need help with skripts

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need to vent about something

tumblr_lqahoaPLkC1ql1l0v.gif

>[ ‧₊˚꒰ʚ Starshine ɞ ‧✦ *#2683 ]<

Link to comment
Share on other sites

3 hours ago, StarBunnie said:

If you want to add a number to a variable use add

add arg 3 to {tokens::%player%}

As you see you also wrote player in your variable which is always the player that executes the command to change that use arg 2 here instead

add arg 3 to {tokens::%arg 2%}

Another thing is you're only using player or now arg 2 this means it will use their name. The issue is if they change their name all their progress is gone : (

add arg 3 to {tokens::%arg 2's uuid%}

That's why you should use uuid instead this stays forever

Here is a quick overview of how it looks for skript:

{tokens::%player%} -> {tokens::starbunnie}

{tokens::%player's uuid%} -> {tokens::aaaaaaaaaa-bbbbbb-cccc-dddd-eeeeee}

 

Thanks for your help!

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...