Wouldn’t that only work if you clicked it with your mouse? Or clicked it on mobile?
What I’m trying to do is open the ui when a button on the keyboard is pressed, like f or something.
local UIS = game:GetService("UserInputService")
local toggle = false
UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.E then
if toggle then
script.Parent.Visible = false
toggle = false
elseif not toggle then
script.Parent.Visible = true
toggle = true
end
end
end)
Local script place it inside whatever UI you want to “open”. This script will toggle the visibility of the particular UI element whenever the “E” key is pressed.