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

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

TheCubPlays

Member
Jun 22, 2021
42
3
8
24
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:
if 3 > 5:
 send "test" to player
 send "test2" to player
 send "test3" to player
 send "test4" to player
 send "test5" to player
 send "test6" to player
 send "test7" to player

Is the code above laggier than the code bellow?


Code:
if 3 > 5:
 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)
 
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.
 
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.
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.
 
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.
 
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.
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
 
Status
Not open for further replies.