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

How to bind a button and a key together?

Asked by
Nikkulaos 229 Moderation Voter
5 years ago

Is there a way to bind a button to a key input so that when you press the button it would basically do the same as if you pressed the key?

Ive looked into sendkeyevent, but i dont understand how to use it.

Thanks

(this is a madeup example of what im trying to achieve)

local uis = game:GetService("UserInputService") 
local player = game.Players.LocalPlayer

script.Parent.MouseButton1Down;Connect(function()
    uis:SendKeyEvent("q",player)
end)

0
I don't think there is. Is there a reason you need to do this though? You could unbind ROBLOX inputs with ContextActionService or script it for a key to do the same thing. PhantomVisual 992 — 5y

Answer this question