Trying to fix lag in loops

Hello, developers! I am trying to fix performance issues in my game.

I have made a thread asking which was better, task.wait or wait. (Task.wait() vs wait() in loops) I have concluded that task.wait is better, but it causes issues.

My first problem is that whenever I change wait to task.wait it causes some weird problems.
For example:


My second problem is trying to convert all wait functions to task.wait, but there isn’t a real way to do that without causing extreme lag and changing stuff like Character:Wait() to Character:task.wait().

I’m losing players because of this. :confused:

Please help me!
Thanks!