You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
For the player to select a key(keybind) to then show on the textbox,
(Player>select key… show key in textbox, the player can see the key they select in the textbox
What is the issue? Include screenshots / videos if possible!
Well I have a gui, and also a textbox, but when the player enters the key they want, then it dosent assign it nor show that they choose it
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have been looking for a while on the Web to see if I could see any thing relating to the issue, but i couldn’t see anything about it
Create a StringValue inside the LocalScript and replace your TextBox with a TextButton
local UserInputService = game:GetService("UserInputService")
local StringValue = script.--StringValue Name
local TextButton = --Path to TextButton
local ChangingKeybing = false
ChangingKeybind = true
TextButton.Text = "Press something"
if ChangingKeybind == false then
if Input.KeyCode == Enum.KeyCode[StringValue.Value] then
local Key = string.sub(tostring(Input, 1, 13))
TextButton.Text = Key
StringValue.Value = Key
local UIS = game:GetService("UserInputService")
local TextBox = script.Parent -- So This Script Is Fine Parented Into The TextBox Itself
if Input.UserInputType == Enum.UserInputType.Keyboard then
if TextBox:IsFocused() then
Key = Input.KeyCode
TextBox.Text = tostring(Input.KeyCode):split(".")
if Input.KeyCode == Key and not Event then
print("You Press The Key!")
-- Your Code Here
for some reason i didnt use :GetStringForKeyCode cuz it just return letters it returns nil when those shift ctrl tab etc
so i just split instead the enumaration on the input keycode