-
What do you want to achieve? Im trying to make a cuff system, and I’m trying to make it so users can configure keybinds for open/close and other actions.
-
What is the issue? I don’t think the key presses are registering or I’ve configured the module script wrong.
-
What solutions have you tried so far?
Devhub, youtube
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
Module script:
local settingsconfig = {}
settingsconfig.Groups = {
[1111] = 123;
[232323] = 123
}
settingsconfig.Keybind = {
["open"] = Enum.KeyCode.K;
["close"] = Enum.KeyCode.K;
["arrest"] = Enum.KeyCode.E;
["release"] = Enum.KeyCode.R;
["search"] = Enum.KeyCode.S
}
return settingsconfig
LocalScript:
local userInputService = game:GetService("UserInputService")
local config = require(game.ReplicatedStorage.Config)
userInputService.InputBegan:Connect(function(input, GPE)
if input.KeyCode == config.Keybind.open then
print("Cuffs closed")
elseif input.KeyCode == config.Keybind.close then
print("Cuffs opened")
end
end)