# Simple collide fly bypass

```javascript
var module = rise.registerModule("Collide Fly", "A fly ported from Rise 5 to Rise 6's scripting api.")

module.registerSetting("number", "Speed", 1, 0.1,10,0.1)

script.handle("onUnload", function () {
	module.unregister()
})

// Called 20 times per second
module.handle("onPreMotion", function(e) {
	e.setOnGround(true) // Sets players serverground to true
	player.setMotionY(0) // Sets players motionY to 0

	return e
})

// We use strafe event because this is called right after keypresses are grabbed, causing the fly to feel more responsive
module.handle("onStrafe", function(e) {
	player.stop() // Stops the player
	player.strafe(module.getSetting("Speed")) // Sets players speed to setting
})
```
