I know this sounds confusing, but basically I want to make a button (specifically for mobile users) to fire a keycode. For example, a reload button, if I press the button it will fire the "R" keycode. I don't think there is a way, but if there is please answer. Thanks.
COMMUNITY QUESTION
Is there a way to make a GUI to fire a keycode?
1 answer
You can do it in this way, using VirtualUser service:
gui.MouseButton1Click:Connect(function()
local VS = game:GetService("VirtualUser")
VS:CaptureController()
VS:TypeKey("key_you_wanna_press") -- for example - VS:TypeKey("e")
end)
I am not sure if it will work, but I think it should. Give it a try :).
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
Will try thanks for helping.
No problem.
Did not work, errors with the current identity (2) cannot CaptureController (missing permission 3)