Inputs.lua

Download Latest Version

Inputs is a small library which makes it easier to override the player's input.

Installation
Drop the inputs.lua file in the LuaScriptsLib folder.

How to use
When the API is loaded, it will monitor the key press states of all the player inputs and store them in the inputs.state[] table. You can access the state for a given key by using the corresponding key name in lowercase (i.e. player.jumpKeyPressing --> inputs.state["jump"], player.dropItemKeyPressing --> inputs.state["dropitem"]). Instead of a basic boolean, Inputs stores the state as one of four constants: inputs.UP, inputs.PRESS, inputs.HOLD, and inputs.RELEASE.

If inputs.locked[keyname] is set to true, the corresponding movement will be disabled without impacting inputs.state[].

If inputs.debug is set to true, the states of each key will be displayed on the side of the screen.

Example
This will replace spin jumping with a boomerang.