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 Help with list variables.

Discussion in 'Skript' started by Hecking_Pidgeon, Aug 22, 2021.

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

    Joined:
    Aug 22, 2021
    Messages:
    2
    Likes Received:
    0
    I'm trying to make it so you can see the time you must wait to use a command again. I understand that you can use "cooldownmessage:" and %remaining time% for that, but it shows 2 decimal places. I want it to only show whole seconds. Here is the code that I tried. I cannot figure out why it does not work. That is what I need help with.

    every second in "world":
    loop {timecooldown::*}:
    if {timecooldown::%loop-index%} is greater than 0:
    subtract 1 from {timecooldown::%loop-index%}
    command /time:
    trigger:
    if {timecooldown::*} does not contain {%player%.timecooldown}:
    add {%player%.timecooldown} to {timecooldown::*}
    if {timecooldownlist::%player%.timecooldown} is not set:
    set {timecooldownlist::%player%.timecooldown} to 0
    if {timecooldownlist::%player%.timecooldown} is 0:
    set {timecooldownlist::%player%.timecooldown} to 40
    message "you did it" to player
    else:
    message "wait %{%player%.timecooldown}% seconds" to player
     
  2. King_Creeperz

    King_Creeperz Member

    Joined:
    Oct 6, 2020
    Messages:
    40
    Likes Received:
    0
    just loop it alot of times then wait a second then subtract. I am so dumb.
    ok enough jokes... first don't use "in" cause you wanna only use it if you wanna make it only work in this world. if it says that message about (in "world") use loop players. I am kinda new but at least I could help people. I been doing it for a year and I still don't know how to do functions. sorry that I can't help much but its fine. I can't really understand this a bit but at least someone will help you soon.
     
  3. Hecking_Pidgeon

    Joined:
    Aug 22, 2021
    Messages:
    2
    Likes Received:
    0
    I managed to get it to work. Here is that code. I don't really know why this one works and the other doesn't.

    every second:
    loop {commandcooldown::*}:
    if {commandcooldown::%loop-index%} is greater than 0:
    subtract 1 from {commandcooldown::%loop-index%}
    command /time:
    trigger:
    if {commandcooldown::%player%} is not set:
    set {commandcooldown::%player%} to 0
    if {commandcooldown::%player%} is 0:
    message "you did it" to player
    set {commandcooldown::%player%} to 40
    else:
    message "wait %{commandcooldown::%player%}% seconds"
     
Thread Status:
Not open for further replies.

Share This Page

Loading...