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

A gui that opens when pressing q?

Asked by 5 years ago

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?

2 answers

Log in to vote
0
Answered by
NotedAPI 810 Moderation Voter
5 years ago

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.

01local FramePath -- Path to frame
02local UIS = game:GetService("UserInputService")
03 
04UIS.InputBegan:Connect(function(input, GPE)
05    if not GPE then
06        if input.KeyCode == Enum.KeyCode.Q then
07            if FramePath.Visible == false then
08                FramePath.Visible = true
09            elseif FramePath.Visible == true then
10                FramePath.Visible = false
11            end
12        end
13    end
14end)
0
Thank you no0bgaming748 24 — 5y
0
WHAT THE F MAN I JUST MADE A SCRIPT TNTIsLyfe 152 — 5y
0
@TNTIsLyfe LOL. I rushed so hard to make that, took like 20s, I just saw the post. NotedAPI 810 — 5y
0
its ok man u got the script first i lost TNTIsLyfe 152 — 5y
Ad
Log in to vote
-1
Answered by
TNTIsLyfe 152
5 years ago

I hope this script works im not really that good

1Mouse = game.Players.localPlayer:GetMouse()
2Mouse.KeyDown:connect(function(key)
3if (key:byte() == 113) then
4game.StarterGui.(PutGuiNameHere).Enabled = true
5Mouse.KeyUp:connect(function(key)
6if (key:byte() == 113) then
7game.StarterGui.(PutGuiNameHere).Enabled = false
0
1 - Deprecated code. 2- STARTERGUI? It should be PlayerGui Leamir 3138 — 5y
0
ya im not really that mediocre in scripting also what do u mean by deprecated code? to short? TNTIsLyfe 152 — 5y
0
also i posted dis question rn can u help me TNTIsLyfe 152 — 5y
0
deprecated means it uses code that doesn't work anymore Benbebop 1049 — 5y
View all comments (4 more)
0
oh so how can i fix it TNTIsLyfe 152 — 5y
0
@Benbebop The code works, but may stop working at any time because of updates Leamir 3138 — 5y
0
@TNTIsLyfe You need to use UserInputService for fixing that Leamir 3138 — 5y
0
instead of using "KeyDown" to detect user input, use "UserInputService". ScuffedAI 435 — 5y

Answer this question