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.

variable in option

Discussion in 'Skript' started by Stefal, Jan 17, 2023.

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

    Stefal New Member

    Joined:
    May 22, 2021
    Messages:
    5
    Likes Received:
    0
    options:
    Cooldown1: "%{dashCD::%player's uuid%}%"
    on swap hand items:
    cancel event
    if {Dash::%player's uuid%} > 0:
    set {_u} to {_p}'s uuid
    if {dash.last1::%{_u}%} is set:
    set {_wait1} to difference between {dash.last1::%{_u}%} and now
    else:
    set {_wait1} to {@Cooldown1}
    if {_wait1} >= {@Cooldown1}:
    set {dash.last1::%{_u}%} to now
    set player's walking speed to player's walking speed * 5
    wait 15 seconds
    set player's walking speed to player's walking speed / 5
    else:
    send action bar "&cYou need to wait %difference between {_wait1} and {@Cooldown1}%" to player
    I am trying to use a variable in an option and it works fine, but on the last line it gives an error
    invalid brackets/variables/text in ""
     
  2. xdh

    xdh Active Member

    Joined:
    Apr 15, 2020
    Messages:
    78
    Likes Received:
    4
    It might be because you can't pass through a player variable, so %uuid of player% literally has no mean because their is no "player" in the option, just make a variable instead of using an option
     
  3. Pingusate

    Pingusate Active Member

    Joined:
    Mar 29, 2018
    Messages:
    50
    Likes Received:
    4
    Code (Text):
    1.  
    2. on swap hand items:
    3.     set Cooldown1 to {dashCD::%uuid of event-player%}
    4.     cancel event
    5.     if {Dash::%player's uuid%} > 0:
    6.       set {_u} to {_p}'s uuid
    7.       if {dash.last1::%{_u}%} is set:
    8.       set {_wait1} to difference between {dash.last1::%{_u}%} and now
    9.     else:
    10.       set {_wait1} to {@Cooldown1}
    11.        if {_wait1} >= {@Cooldown1}:
    12.          set {dash.last1::%{_u}%} to now
    13.          set player's walking speed to player's walking speed * 5
    14.          wait 15 seconds
    15.          set player's walking speed to player's walking speed / 5
    16.       else:
    17.          send action bar "&cYou need to wait %difference between {_wait1} and {@Cooldown1}%" to player
    18.  
    pretty sure there's tiny mistakes with indents with that i wrote, but this should help you.

    options can be set for general things like permissions, messages, etc, but for variables, you can't really use options for it, options is more for the code rather than the game, the code doesn't recognize the player via code, only via the game itself, so once it loads, it'll recognize what it is supposed to recognize.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...