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.

Skript Lag || If/else if/else statements.

Discussion in 'Skript' started by TheCubPlays, Dec 28, 2021.

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

    TheCubPlays Member

    Joined:
    Jun 22, 2021
    Messages:
    42
    Likes Received:
    3
    Hello! Recently I've been trying to figure out something, if a condition in an if statement is not met, does the amount of lines that comes inside that matter for lag purposes? For example here is what I mean:

    Code (Text):
    1. if 3 > 5:
    2.  send "test" to player
    3.  send "test2" to player
    4.  send "test3" to player
    5.  send "test4" to player
    6.  send "test5" to player
    7.  send "test6" to player
    8.  send "test7" to player
    Is the code above laggier than the code bellow?


    Code (Text):
    1. if 3 > 5:
    2.  send "test" to player
    Both conditions should not be met which means that the code inside the statements will not run, does the fact that the code inside the 1st statement is a lot bigger matter for performance? (If the condition is met it obviously does)
     
  2. TweedeKamer

    TweedeKamer Member

    Joined:
    Sep 6, 2021
    Messages:
    23
    Likes Received:
    1
    Well i think it doesn't really do allot because you are only sending messages. But what is your question here? What do you want to do.
     
  3. TheCubPlays

    TheCubPlays Member

    Joined:
    Jun 22, 2021
    Messages:
    42
    Likes Received:
    3
    Well the code itself is not the thing, like I mean this specific code wouldn't cause lag either way it was just an example. I'm trying to make some quests and it requires me to check if a variable is equal to something every time (so if they completed the quest) and since the code after that is kinda big I wanna make sure that it doesn't matter how big it is when it comes to performance, since it'd only be executed once.
     
  4. TweedeKamer

    TweedeKamer Member

    Joined:
    Sep 6, 2021
    Messages:
    23
    Likes Received:
    1
    Ow so you just want to know if allot of code can cause lag? Because yeah for example i had some loops that caused lag. But i have never had the problem i think that my server lagged because of allot of code.
     
  5. TheCubPlays

    TheCubPlays Member

    Joined:
    Jun 22, 2021
    Messages:
    42
    Likes Received:
    3
    Ok I guess I'll keep that in mind, thanks.

    I'll keep this open until I get a guaranteed answer about this or if I do figure it out my self
     
Thread Status:
Not open for further replies.

Share This Page

Loading...