Well it’s impossible to stop exploiting 100%, but there are certain things you can do like for your flying problem you can track the players position and if they go out of range in that position you could assume they were flying. There’s a bunch of different ways to go about this so ill leave some links to better posts that go in depth on this.
Exploit Prevention (Version 1) - Resources / Community Resources - Roblox Developer Forum
Exploiting Explained - Resources / Community Resources - Roblox Developer Forum
For future references I would highly suggest searching for your answer first. There’s hundreds of these posts and I can guarantee you’ll find an answer/solution to your problem in one of them