Hello. I am trying to make a stand game but the problem is that one ability takes 11 seconds to load (Ability Function Has: 800+ lines of code). I tried to optimize (From DevForum) but it does not make a big difference. The script has very much corontine.wrap(), if statements, else, loops but i cant remove them.
You might ask why u need if statements?
I need to make fully customable like [“Damage”] = 10, etc…
The biggest time waste will be any yielding like calling wait(). Another big time waster is loops. Line count usually doesn’t affect it and excepting very rare cases, using if statements won’t really affect the speed of the code too.
Since the game isn’t completely stalling (or at least you didn’t say that). I’m assuming your using wait or task.wait() for timing things or stuff. The most likely thing to speed up your code would be to remove as much of those as you can, or making it so that any yields get spawned as their own task so it doesn’t effect the main part.