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 4 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
4 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.

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)
0
Thank you no0bgaming748 24 — 4y
0
WHAT THE F MAN I JUST MADE A SCRIPT TNTIsLyfe 152 — 4y
0
@TNTIsLyfe LOL. I rushed so hard to make that, took like 20s, I just saw the post. NotedAPI 810 — 4y
0
its ok man u got the script first i lost TNTIsLyfe 152 — 4y
Ad
Log in to vote
-1
Answered by
TNTIsLyfe 152
4 years ago

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
0
1 - Deprecated code. 2- STARTERGUI? It should be PlayerGui Leamir 3138 — 4y
0
ya im not really that mediocre in scripting also what do u mean by deprecated code? to short? TNTIsLyfe 152 — 4y
0
also i posted dis question rn can u help me TNTIsLyfe 152 — 4y
0
deprecated means it uses code that doesn't work anymore Benbebop 1049 — 4y
View all comments (4 more)
0
oh so how can i fix it TNTIsLyfe 152 — 4y
0
@Benbebop The code works, but may stop working at any time because of updates Leamir 3138 — 4y
0
@TNTIsLyfe You need to use UserInputService for fixing that Leamir 3138 — 4y
0
instead of using "KeyDown" to detect user input, use "UserInputService". ScuffedAI 435 — 4y

Answer this question