Have you tried this on any other games?
Could just be your computer has more tasks to perform outside of Roblox (running the autoclicker) that it takes away from your overall processing power.
Scott is probably right, depending on how many areas you have “detecting M1/Mouse Location/Input if else then or and” and how the entire setup is structured / where the scripts are run [server/client] etc. Most likely you just need to do optimize your setup a bit for player input.
After doing some more digging, I have realised there was a script that was messing with ANY of the player inputs, weither that would be the mouse or keys, I have deleted the script as it didn’t have much use either way. This is why I, alongside everyone should always delete unecessary scripts that you don’t need anymore, because issues like these can happen.
I was mainly looking for mouse inputs only because well, they were the only ones lagging the game and so I thought that was the specific issue. I didn’t think about checking ALL of the inputs until now, so thank you!