How would I make it so when a key is pressed the, GUI is visible to whoever pressed the button.
In a localscript do:
local uis = game:GetService("UserInputService") local gui = script.Parent --// Define the gui local open = false uis.InputBegan:Connect(function(key) if key == Enum.KeyCode.K and not open then gui.Enabled = true open = true elseif key == Enum.KeyCode.K and open then gui.Enabled = false open = false end end)
Accept answer if it works else tell me
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?