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 Wait for argument seconds?

Discussion in 'Skript' started by Hakuyamu, Oct 29, 2018.

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

    Hakuyamu Member

    Joined:
    Oct 29, 2018
    Messages:
    33
    Likes Received:
    0
    Hello!

    In one of my Skripts I want to use a command which sets a variable to true and after a given time to false. This is an example:

    Code (Skript):
    1. command /wait <number>:
    2.     trigger:
    3.         message "&2The value has been set to true for %argument% seconds"
    4.         set {value.%player%} to true
    5.         wait argument seconds
    6.         message "&4The value has been set to false"
    7.         set {value.%player%} to false
    If I create a new file within this code, I always get this resonse:

    Code (Skript):
    1. 'seconds' is not a type (example.sk, line 5: wait argument seconds')
    I really need anything like this that works and I have no plan how to solve this.

     

    Attached Files:

  2. Best Answer:
    Post #6 by ShaneBee, Oct 29, 2018
  3. BrettPlayMC

    Supporter

    Joined:
    Jan 26, 2017
    Messages:
    715
    Likes Received:
    53
    Use arg-1 in line 5.
     
  4. Hakuyamu

    Hakuyamu Member

    Joined:
    Oct 29, 2018
    Messages:
    33
    Likes Received:
    0
  5. BrettPlayMC

    Supporter

    Joined:
    Jan 26, 2017
    Messages:
    715
    Likes Received:
    53
    DId you replace argument with it?
     
  6. Hakuyamu

    Hakuyamu Member

    Joined:
    Oct 29, 2018
    Messages:
    33
    Likes Received:
    0
    Yes, I did.

    .. I'm not nooby at Skript
     
  7. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    im not sure if this will work, the devs of Skript have all said this is an issue, but you could try something like
    Code (Skript):
    1. wait "%arg-1% seconds" parsed as timespan
    that may or may not work. Theoretically it should, but I know there's been issues with Skript in this one.
    You could also try
    Code (Skript):
    1. set {_wait} to "%arg-1% seconds" parsed as timespan
    2. wait {_wait}
     
Thread Status:
Not open for further replies.

Share This Page

Loading...