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

  • 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.
Jun 6, 2018
20
0
0
21
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”
 
Last edited:
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
 
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
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.
 
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
 
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
 
O
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
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
 
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
 
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
 
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
 
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_language.skript:
command /anvil <player>:
    trigger:
        set {command::arg} to arg-1

on event:
    #do something
    #where you would want to use your argument, use {command::arg} instead
    #because {command::arg} is now set to whatever you had in the original argument

    #after you are done with your argument, clear it
    clear {command::arg}
 
Status
Not open for further replies.