Hello all,
I was recently creating a custom keybind system for my game, and i have struggled a bit with detecting if a UIS input is one of the keybinds.
here’s essencially what im doing:
local UIS = game:GetService("UserInputService")
local Player = game.Players.LocalPlayer
local Char = Player.Character
local BindFolder:Folder = Char.KeybindContainer
local BindTable = {
BindFolder:WaitForChild("BindOne")
--etc, through five binds
--the "binds" are string values inside a folder. this feels rather inefficient to me, there honestly has to be a better way to do this. whatever.
}
function Connection(Input, GPE)
if GPE then return end
if BindTable[Input.Keycode] then
--remote connection
end
--how would i detect that?!?
--for reference, i also have a module that saves and loads DataStores for keybinds.
--however, i dont want to save a datastore everytime they update their keybinds, that would be terrible honestly.
--i also tried Attributes but i didn't know what i should parent them to.
--also, i dont just need to know if it was one of the keybinds, i need to know WHAT keybind it was, so i can fire the appropriate RemoteEvent.
thank you for your time.