Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

GUI Keybind script like Strucid and games?

Asked by 2 months ago

So I am trying to make a keybind gui, I already have it all done I just want it where if the player clicks on the textbox than clicks say RightShift than in the Textbox it will change the text to: RightShift Normally if you did that it won't do nothing. I don't know how to do this so a link to a thread or something will be extremely helpful! I was thinking it was input changed but I do not know for sure I tried multiple things. Just don't know which one is the proper way.

1 answer

Log in to vote
0
Answered by 2 months ago
Edited 2 months ago

You can use InputBegan on the textlabel and make it so that if a key is pressed, it changes the text of the textlabel to the key. (script.Parent is referring to the textlabel)

```

local userInputService = game:GetService("UserInputService") script.Parent.InputBegan:Connect(function(input)

if input.UserInputType == Enum.UserInputType.Keyboard then

script.Parent.Text = userInputService:GetStringForKeyCode(input.KeyCode)

end

end)

0
This, did not work. I am looking for a TextBox. So when I click on said textbox I will begin to edit the text, say I click LeftControl then it will change the TextBox Text to said LeftControl. Anything like this you know how to do? Thanks though! ZeroTrool 0 — 2mo
0
Still looking!!! ZeroTrool 0 — 2mo
0
This is wrong. BashCaster 2170 — 2mo
Ad

Answer this question