Solved What's better to use a 'while' or a 'loop'?

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

Uzumaki

Well-Known Member
Feb 20, 2017
310
10
18
33
What's better to use a 'while' or a 'loop' for a better performance?

Examples

code_language.skript:
while {games-status} is "ingame":
    remove 1 from {seconds}
    wait 1 seconds
    
loop 1000 times:
    remove 1 from {seconds}   
    wait 1 seconds
 
What's better to use a 'while' or a 'loop' for a better performance?

Examples

code_language.skript:
while {games-status} is "ingame":
    remove 1 from {seconds}
    wait 1 seconds
   
loop 1000 times:
    remove 1 from {seconds}  
    wait 1 seconds

You should use GameAPI Addon, it's much easier if you are making MiniGames, than this junk. But if you were to not use it, I would say that while loop is your better option, since the "Loop 1,000 times", will keep going even after the game ends, unless you exit the looping
 
Status
Not open for further replies.