I have a question. How can I make a UI where you press a button on your keyboard to cycle through it. For example, you press the right arrow to cycle to the GUI to the right side? Thank you.
Important Information: If this is considered asking someone for code or a script then, please let me know so that I can delete this topic.
Well, just because somebody does something that breaks the rules that doesn’t mean that It’s allowed like for example, if everybody hacks each other’s account, that doesn’t mean that hacking is allowed.
--Put inside TextButton/ImageButton
local UIS = game:GetService("UserInputService")
local Keys = {
Up = Enum.KeyCode.Up;
Left = Enum.KeyCode.Left;
Right = Enum.KeyCode.Right;
Down = Enum.KeyCode.Down
}
local ButtonToMove = script.Parent
UIS.InputBegan:Connect(function(input)
local LocaleKeycode = input.KeyCode
if LocaleKeycode == Keys.Up then
ButtonToMove.Position += UDim2.fromScale(0,-0.1)
elseif LocaleKeycode == Keys.Left then
ButtonToMove.Position += UDim2.fromScale(-0.1,0)
elseif LocaleKeycode == Keys.Right then
ButtonToMove.Position += UDim2.fromScale(0.1,0)
elseif LocaleKeycode == Keys.Down then
ButtonToMove.Position += UDim2.fromScale(0,0.1)
end
end)
Okay so put this inside a TextButton. put in a localscript
Then You can change the keys from “up left right down” to w a s d or what u want. then you can play test and the button will move as the keys are pressed