Since the new input instances of roblox released recently i wanted to make a module for it which is easy to use efficient and clean coded.
There’s
:Connect(function):Disconnect()
:SetSetState(Boolean)
:ChangeKeys(NewKeyTable)
.New(Parameters)
Cooldowns, Multiple functions for one Action, Multiple keycode bindings for one function,
Aswell as every Property from the whole table which are changable aswell
Here’s an example on how u can use it
local NewAction = Input.New(
"UI",
"Interact",
{
KeyboardBinding = { Enum.KeyCode.E, Enum.KeyCode.F },
GamepadBinding = { Enum.KeyCode.ButtonY },
TouchBinding = { MainUI.Hud.Bottom.Shop.TextButton }
},
1
)
local Connection = NewAction:Connect(function()
print("Hi")
end)
NewAction:ChangeKeys({
KeyboardBinding = { Enum.KeyCode.T, Enum.KeyCode.G },
})
task.wait(2)
NewAction:SetState(false)
task.wait(1)
Connection:Disconnect()
![]()
Here’s the Module
Aswell as an explanation (Made it kinda fast)