> For the complete documentation index, see [llms.txt](https://riseclients-organization.gitbook.io/rise-6-scripting-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://riseclients-organization.gitbook.io/rise-6-scripting-api/examples/simple-collide-fly-bypass.md).

# 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
})
```
