variable in option

  • 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.

Stefal

New Member
May 22, 2021
5
0
1
18
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 ""
 
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 ""
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
 
Code:
on swap hand items:
    set Cooldown1 to {dashCD::%uuid of event-player%}
    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

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.
 
Status
Not open for further replies.