Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Keybind tween is hard? who knew

Asked by 4 years ago
Edited by Shawnyg 4 years ago

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)


0
Fixed your code block Shawnyg 4330 — 4y
0
Really? SharkyNarlyYTAlt 26 — 4y

Answer this question