Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Does if statements cause lag? [closed]

Asked by 6 years ago

Does too many if statements cause lag or nah. Like checking if something exists or something.

0
Why would you be concerned about this? Optimizing your code is a waste of time unless it is really necessary.  Zafirua 1348 — 6y

Closed as Non-Descriptive by User#19524

This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.

Why was this question closed?

2 answers

Log in to vote
-2
Answered by 6 years ago

This mainly depends on what the if statements are doing. Try to avoid using a lot of if statements if you can and try to optimize your scripts.

Ad
Log in to vote
0
Answered by 6 years ago

I think too many if statements just clutters up your script not much lag unless your doing like if player.Character.Health == 5 then create 1000 explosions