I have a GUI that is activated with the Button G, It's an information GUI about my game. How would I make it tweened with a keybind? KEYBIND CODE

local frame = script.Parent.Parent.Frame 
local hotkey = Enum.KeyCode.G 

local UIS = game:GetService("UserInputService")
local open = false



UIS.InputBegan:Connect(function(key, gp)
	if key.KeyCode == hotkey then
		if UIS:GetFocusedTextBox() == nil then
			if open == false then
				open = true 
				frame.Visible = open
			elseif open == true then
				open = false
				frame.Visible = open
			end
		end
	end
end)


script.Parent.MouseButton1Click:Connect(function()
	if open == false then
		open = true
		frame.Visible = open
	elseif open == true then
		open = false
		frame.Visible = open
	end	
end)


2 comments

0

Fixed your code block

0

Really?