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

How would I make a script where when I press a key, a gui pops up? [closed]

Asked by 7 years ago

Please help, I can get all the help I need. Post script below.

Closed as Not Constructive by Goulstem

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

2 answers

Log in to vote
-1
Answered by 7 years ago
Edited 7 years ago

for making the gui visible

gui.Enabled = true

or

gui.Visible = true

Click me

Ad
Log in to vote
-1
Answered by
RootEntry 111
7 years ago
Edited 7 years ago

This is a short answer change to what key you want This is just an example.

local player = game.Players.LocalPlayer -- The localplayer
local GUI = player:FindFirstChild("PlayerGui"):FindFirstChild("ScreenGuiName") --Change this to your gui name.
local frame = GUI:FindFirstChild("Frame")
local mouse = player:GetMouse() -- Gets the players mouse
open = false -- This is the debounce

--//main script\\--

mouse.KeyDown:connect(function(key)
              if (key == "g") then -- Change this to your key you want.
                   if (open == false) then
                         frame.Visible = true -- makes the frame visible
                         open = true -- Makes the debounce.
                    elseif (open == true) then
                         frame.Visible = false -- Makes the frame unvisible
                         open = false -- Makes the debounce.
                   end
             end
end)