Not a coding question but a practice question, what is the best way to write loops ( been using i,v in pairs) and is using module scripts laggy. Also what is the best way to eliminate lag from unknown problems(finding them and fixing them), Thank you
In roblox studio under view there is a script performance window which will help you find which script are lagging.
Also I haven't tested this but splitting all of the scripts apart may help to spread the workload so that all of the work is not being done by one or two scripts.
hope this helps
For loops, I suggest you read this
Another thing to take note is the Spawn function and coroutines. Using separate threads instead of just one may improve the performance in your scripts.