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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    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.

Solved How to use arg-1 for the next paragraph?

Discussion in 'Skript' started by Galacticstar123, Jun 13, 2018.

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

    Joined:
    Jun 6, 2018
    Messages:
    20
    Likes Received:
    0
    Code (Skript):
    1. command /test  <text>:
    2.     trigger:
    3.         open an anvil gui named "Test" to player with default text "Write what you want!"
    4.        
    5. on close anvil gui named "Test":
    6.     broadcast "%arg-1%  %event-text%!"
    7.  
     
  2. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    easy peasy

    so set a variable from your arg, and broadcast your variable instead

    Code (Skript):
    1. command /test  <text>:
    2.     trigger:
    3.         open an anvil gui named "Test" to player with default text "Write what you want!"
    4.         set {text::text} to arg-1
    5.      
    6. on close anvil gui named "Test":
    7.     broadcast "%{text::text}%  %event-text%!"
    8.     clear {text::text}
    9.  
     
    • Like Like x 1
  3. Galacticstar123

    Joined:
    Jun 6, 2018
    Messages:
    20
    Likes Received:
    0
    Ty I’ll try it as soon as I get home :emoji_grinning:
    --- Double Post Merged, Jun 14, 2018, Original Post Date: Jun 14, 2018 ---
    Just asking 1 more question, because I am using the variable in a command, is that possible?
     
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    Based on your code you sent you aren’t using a variable in your command. You are just setting it.
    But yes, you are able to use a variable in a command. Well... I guess it would depend on exactly how you’re using it
     
    • Like Like x 1
  5. Galacticstar123

    Joined:
    Jun 6, 2018
    Messages:
    20
    Likes Received:
    0
    Thank you so much, it worked :emoji_grinning:
     
  6. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    You’re welcome
     
    • Like Like x 1
Thread Status:
Not open for further replies.

Share This Page

Loading...