Hey would anyone be able to help me with a gui as I would like it to show a gui when a user has pressed "q" And not sure how is anyone able to help?
✓ ANSWER ACCEPTED
A gui that opens when pressing q?
2 answers
✓ Accepted answer
Hello, I'm xWhiteHat. I'll be trying to help you with your request. I've made this script that should work how you asked.
local FramePath -- Path to frame
local UIS = game:GetService("UserInputService")
UIS.InputBegan:Connect(function(input, GPE)
if not GPE then
if input.KeyCode == Enum.KeyCode.Q then
if FramePath.Visible == false then
FramePath.Visible = true
elseif FramePath.Visible == true then
FramePath.Visible = false
end
end
end
end)
I hope this script works im not really that good
Mouse = game.Players.localPlayer:GetMouse()
Mouse.KeyDown:connect(function(key)
if (key:byte() == 113) then
game.StarterGui.(PutGuiNameHere).Enabled = true
Mouse.KeyUp:connect(function(key)
if (key:byte() == 113) then
game.StarterGui.(PutGuiNameHere).Enabled = false
8 comments
0
1 - Deprecated code. 2- STARTERGUI? It should be PlayerGui
0
ya im not really that mediocre in scripting also what do u mean by deprecated code? to short?
0
also i posted dis question rn can u help me
0
deprecated means it uses code that doesn't work anymore
0
oh so how can i fix it
0
@Benbebop The code works, but may stop working at any time because of updates
0
@TNTIsLyfe You need to use UserInputService for fixing that
0
instead of using "KeyDown" to detect user input, use "UserInputService".
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
Thank you
WHAT THE F MAN I JUST MADE A SCRIPT
@TNTIsLyfe LOL. I rushed so hard to make that, took like 20s, I just saw the post.
its ok man u got the script first i lost