Making a relatively simple keybind system but I get this error when accessing data from the keybind, heres how im doing it
if input.UserInputType == Enum.UserInputType[KeybindSettings.currentKeybinds][tool.Name][script.Name] or input.KeyCode == Enum.KeyCode[KeybindSettings.currentKeybinds][tool.Name][script.Name] then
print("Worked")
end
invalid argument #2 (string expected, got table)
Here is the moduleScript im accessing it from
currentKeybinds = {
["Pass"] = {
["Pass"] = "MouseButton1" -- The one im trying to make work right now.
},
["Kick Types"] = {
["Backspin"] = "Q"
}
}
Okay, I figured out that it has to do with the way I indexxed it, it’s just weird but I just turned it into a variable like this
local keybind = KeybindSettings.currentKeybinds[tool.Name][script.Name]
if input.UserInputType == Enum.UserInputType[keybind] or input.KeyCode == Enum.KeyCode[keybind] then
print("Work")
end