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
    how to use the same argument (arg-1) from the first event in the second event? for example, this command /anvil <player> will open up an anvil GUI. (<--- first event). on close anvil GUI (<----- second event), arg-1 from the first event can't be used anymore. sorry, i'm a skript noob.

    Edit: changed “paragraph” into “event”

     
    #1 Galacticstar123, Jun 13, 2018
    Last edited: Jun 13, 2018
  2. Best Answer:
    Post #20 by ShaneBee, Jun 14, 2018
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    Not really sure what you mean by a paragraph, but if its within the same event, you can use arg-1 anywhere.... if its in another event, you would probably have to save the argument into a variable, and use the variable
     
  4. Galacticstar123

    Joined:
    Jun 6, 2018
    Messages:
    20
    Likes Received:
    0
    I tried using a variable, but I failed :emoji_frowning: because the first event is triggered by a command, and that’s when arg-1 is recorded.
     
  5. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    okay, well show your code and i will see if i can help you out
     
  6. Galacticstar123

    Joined:
    Jun 6, 2018
    Messages:
    20
    Likes Received:
    0
    I am not rlly at home, i’m Typing on my iPad.

    But I used WolvSK as my Addon and their example for an anvil GUI

    I’ll link the example for u later, I’ve currently got McDonald’s Internet
     
  7. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    ok cool :emoji_slight_smile:
    definitely easier to help when i can see your code :emoji_wink:
     
  8. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    ah i see... well if the PLAYER is closing the anvil, then just use player instead of arguments
     
  9. Galacticstar123

    Joined:
    Jun 6, 2018
    Messages:
    20
    Likes Received:
    0
    I need arg-1 at on anvil close event
     
  10. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    there are no arguments in a close event... arguments are things that are typed, if you are opening a gui TO a player.... when THEY close it ... they are then the person running the event

    Like i said, it'll be easier to help when i can see the code you have written
     
  11. Galacticstar123

    Joined:
    Jun 6, 2018
    Messages:
    20
    Likes Received:
    0
    O
    k. So is there any way doing it? Like creating a txt file(don’t know if it’s even possible) called ban wave,and on anvil close ban those players in the banwave
     
  12. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    you can copy and paste your code into a code block on here.
    just click the little plus above the box you type in, hit code, and paste your code into there
     
  13. Galacticstar123

    Joined:
    Jun 6, 2018
    Messages:
    20
    Likes Received:
    0
    Like I’ve said, i’m a Skript noob. I used th exact example code except changing some text XD

    Like adding arg 1 in the command, that’s basically all
     
  14. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    well send what you have, so i can see what you have written and try help you accomplish what you are trying to do
     
  15. Galacticstar123

    Joined:
    Jun 6, 2018
    Messages:
    20
    Likes Received:
    0
    I am not at home :emoji_frowning:
    I am using my iPad, it doesn’t have my code
     
  16. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    then why are you looking for help if you don't have any code currently written?
    Im confused as what you actually need help on then, if you do not have anything written
     
  17. Galacticstar123

    Joined:
    Jun 6, 2018
    Messages:
    20
    Likes Received:
    0
    I looked for help at home
     
  18. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    well when you have some code written and can send it, do that, and i will try to help you
     
    • Like Like x 1
  19. Galacticstar123

    Joined:
    Jun 6, 2018
    Messages:
    20
    Likes Received:
    0
    Well I am make the code right now, cuz it’s ez
    --- Double Post Merged, Jun 14, 2018, Original Post Date: Jun 14, 2018 ---
    I can*
     
  20. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    this is the basic of what you are looking for

    in your command (the one that opens the anvil gui) set a variable to your argument
    then in your event that has no arg, use the variable instead

    Code (Skript):
    1. command /anvil <player>:
    2.     trigger:
    3.         set {command::arg} to arg-1
    4.  
    5. on event:
    6.     #do something
    7.     #where you would want to use your argument, use {command::arg} instead
    8.     #because {command::arg} is now set to whatever you had in the original argument
    9.  
    10.     #after you are done with your argument, clear it
    11.     clear {command::arg}
     
    • Winner Winner x 1
Thread Status:
Not open for further replies.

Share This Page

Loading...