Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Does if statements cause lag?

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

1 comment

0

Why would you be concerned about this? Optimizing your code is a waste of time unless it is really necessary. 

2 answers

✓ Accepted answer

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.

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

This discussion is preserved as it was. New answers, comments, and votes are closed.