You could probably change the task.wait() to task.wait(1/60). Since task.wait() waits exactly one frame, it’ll run about 4 times as often at 240 FPS, unless normalized.
You should probably find a way to incorporate frametimes into this, since low FPS players (namely mobile devices) will still dash slower than those who can hit your target expected framerate.