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

LMKgaming

Member
Mar 13, 2025
21
1
3
28
code_language.skript:
on load:
    set {autoCraftTime::default} to 30
    set {autoCraftTime::elite-soldier} to 20
    set {autoCraftTime::general} to 15
    set {autoCraftTime::senior-general} to 10
    set {autoCraftTime::captain} to 5
    set {autoCraftTime::elite-captain} to 3
    set {autoCraftTime::sergeant} to 2

loop {autoCraftTime::*}:
    set {_time} to loop-value
    every {_time} seconds:
        broadcast "%{_time}%"
I don't know why this syntax not run. This syntax meet error at line loop {autoCraftTime::*}:
So i change syntax into
code_language.skript:
on join:
    loop {autoCraftTime::*}:
        set {_time} to loop-value
        every {_time} seconds:
            broadcast "%{_time}%"
And now this continue meet error at line every {_time} seconds:
Can anyone know how to fix that? Please help me!
I'm using:
  • skript-2.10.1
  • skRayFall-v1.9.28
  • skript-placeholders-1.7.0
  • SkBee-3.9.2
 
code_language.skript:
on load:
    set {autoCraftTime::default} to 30
    set {autoCraftTime::elite-soldier} to 20
    set {autoCraftTime::general} to 15
    set {autoCraftTime::senior-general} to 10
    set {autoCraftTime::captain} to 5
    set {autoCraftTime::elite-captain} to 3
    set {autoCraftTime::sergeant} to 2

loop {autoCraftTime::*}:
    set {_time} to loop-value
    every {_time} seconds:
        broadcast "%{_time}%"
I don't know why this syntax not run. This syntax meet error at line loop {autoCraftTime::*}:
So i change syntax into
code_language.skript:
on join:
    loop {autoCraftTime::*}:
        set {_time} to loop-value
        every {_time} seconds:
            broadcast "%{_time}%"
And now this continue meet error at line every {_time} seconds:
Can anyone know how to fix that? Please help me!
I'm using:
  • skript-2.10.1
  • skRayFall-v1.9.28
  • skript-placeholders-1.7.0
  • SkBee-3.9.2
I do not think it's possible to do what you're trying to do in the way you're doing it in your code. Every X [Timespan] is a standalone statement meaning you can't have on join event then every X [Timespan] due to how it works. You will have to instead change around your code to do its intended effect.
 
I do not think it's possible to do what you're trying to do in the way you're doing it in your code. Every X [Timespan] is a standalone statement meaning you can't have on join event then every X [Timespan] due to how it works. You will have to instead change around your code to do its intended effect.
Is there anyway to using syntax every {variable} seconds: because it maybe difficult if i need to change the time looping, that why i make a config list to store time looping as variable
 
I dont think its that hard if you use for example while loop and then just wait {variable} seconds
 
Well im not sure why are you looping the list here, but
Code:
set {looping} to true
loop {autoCraftTime::*}:
    while {looping} = true:
        set {_time} to loop-value
        broadcast "%{_time}%"
        wait {_time} seconds
something like this, its really hard to make code when I dont even know what are you trying to do, but you can inspire from this.
 
Well im not sure why are you looping the list here, but
Code:
set {looping} to true
loop {autoCraftTime::*}:
    while {looping} = true:
        set {_time} to loop-value
        broadcast "%{_time}%"
        wait {_time} seconds
something like this, its really hard to make code when I dont even know what are you trying to do, but you can inspire from this.
I think your code mean
Do something and Wait 30s and do something again then wait 20s and continue
But what I want is:
Every 30 seconds:
# do something
Every 20 seconds:
# đó something
And more
Each every loop work independently with the others, because the time for each loop depend on another permission of player (in my situation this is the rank of player)
My question is how to I make the code run like above but the time is save in config list and using loop through config list to make all Every loop like above.
 
Oh I see, why dont you just use the every X seconds event when you know every time you want do something instead of giving them inside of config? I mean you are making it so much harder.
 
  • Like
Reactions: LMKgaming