Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Binding 'taken' keys?

Asked by
Azarth 3141 Moderation Voter Community Moderator
10 years ago

How do you bind the '/' and enter key?

-- edit: Actually I haven't tried it, does it work like normal when you disable the chat?

0
If chat is disabled, I expect them to work normally. BlueTaslem 18071 — 10y
0
I don't believe that is the case for the backslash, BlueTaslem, unless something has changed between a couple of months ago and now. duckwit 1404 — 10y

1 answer

Log in to vote
2
Answered by 10 years ago

I recommend looking into UserInputService events. They are harder to understand than regular mouse events, but it will let you use any key on keyboard as well as some other fancy inputs.

So to bind the '/' key, you could use this script:

inputService = game:GetService("UserInputService")

inputService.InputBegan:connect(function(input)
    if input.UserInputType == Enum.UserInputType.Keyboard then
        if input.KeyCode == Enum.KeyCode.Slash then
            print("/ key has been pressed!")
        end
    end
end)
0
Ay, that's what I was looking for, thanks. Azarth 3141 — 10y
Ad

Answer this question