Solved Need help

  • 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 community!

    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.

skanto123

Active Member
Jan 8, 2018
70
0
0
if arg 1 is set:
if arg 2 is "pvp" or "PvP" or "PVP":
if arg 3 is set:
give %arg 3% of apple named "&6test" to %arg 1%

arg 1 is player arg 3 is amount
I want to make it so that arg 1 gets arg 3 of apples named "&6test" this dosnt work http://prntscr.com/hxjym6
 
Solution:
code_language.skript:
if arg 1 is set:
    if arg 2 is "pvp":
        if arg 3 is set:
            if arg 1 is a player:
                give arg-3 of apple named "&6Test" to "%arg-1%" parsed as player
                message "You've given %arg-1% an amount of %arg-3% apples." to player
                message "You've granted %arg-3% apples from %arg-1%!" to "%arg-1%" parsed as player

In this case you don't need the percentages, because you're not using it as a text.
I also checked if the first argument is a player, to check if you've entered a player in the command.
The 'parsed as player' makes sure the argument is a player.

I'm seeing you're pretty new to Skript, so if you've got questions, ask them :emoji_wink:
 
Status
Not open for further replies.