Solved give and argument

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

Qurao

New Member
Jul 10, 2020
7
0
1
23
I am trying to write a code to transfer gold nuggets between players.

I am trying to write a code to transfer gold nuggets between players

I tried to enter a code like this through the code, but it didn't work:

give arg-1 gold nuggets to arg-2

I had to stop at such a solution. What can be done since this decision is clearly bad?


make console execute command "give %arg-2% gold_nugget %arg-1%"
make console execute command "clear %player% gold_nugget %arg-1%"


Full code:


command /pay <number> <player>:
trigger:
if number of gold nuggets in the player's inventory >= arg-1:
if distance between player and arg-2 is smaller than 5:
send "§9Вы передали %{rpname.%arg-2%}% %arg-1% §9золотых"
send "§9 %{rpname.%player%}% передал вам %arg-1% §9золотых" to arg-2
make console execute command "give %arg-2% gold_nugget %arg-1%"
make console execute command "clear %player% gold_nugget %arg-1%"
else:
send "§4Игрок слишком далеко!"
else:
send "§4Недостаточно золотых!"
 
I am trying to write a code to transfer gold nuggets between players.

I am trying to write a code to transfer gold nuggets between players

I tried to enter a code like this through the code, but it didn't work:

give arg-1 gold nuggets to arg-2

I had to stop at such a solution. What can be done since this decision is clearly bad?


make console execute command "give %arg-2% gold_nugget %arg-1%"
make console execute command "clear %player% gold_nugget %arg-1%"


Full code:


command /pay <number> <player>:
trigger:
if number of gold nuggets in the player's inventory >= arg-1:
if distance between player and arg-2 is smaller than 5:
send "§9Вы передали %{rpname.%arg-2%}% %arg-1% §9золотых"
send "§9 %{rpname.%player%}% передал вам %arg-1% §9золотых" to arg-2
make console execute command "give %arg-2% gold_nugget %arg-1%"
make console execute command "clear %player% gold_nugget %arg-1%"
else:
send "§4Игрок слишком далеко!"
else:
send "§4Недостаточно золотых!"
Try something like this:
code_language.skript:
command /pay <number> <player>:
    trigger:
        if number of golden nuggets in the player's inventory >= arg 1:
            if distance between player and arg 2 < 5:
                send "§9Вы передали %{rpname.%arg 2%}% %arg 1% §9золотых"
                send "§9 %{rpname.%player%}% передал вам %arg 1% §9золотых" to arg 2
                set {_int} to arg 1
                give {_int} of golden nugget to arg 2
                remove {_int} of golden nugget from player's inventory
            else:
                send "§4Игрок слишком далеко!"
        else:
            send "§4Недостаточно золотых!"
And send the message error, please.
 
Try something like this:
code_language.skript:
command /pay <number> <player>:
    trigger:
        if number of golden nuggets in the player's inventory >= arg 1:
            if distance between player and arg 2 < 5:
                send "§9Вы передали %{rpname.%arg 2%}% %arg 1% §9золотых"
                send "§9 %{rpname.%player%}% передал вам %arg 1% §9золотых" to arg 2
                set {_int} to arg 1
                give {_int} of golden nugget to arg 2
                remove {_int} of golden nugget from player's inventory
            else:
                send "§4Игрок слишком далеко!"
        else:
            send "§4Недостаточно золотых!"
And send the message error, please.
Thank you, that work)
 
Status
Not open for further replies.