Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

A gui that opens when pressing q?

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

✓ 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)

4 comments

0

Thank you

0

WHAT THE F MAN I JUST MADE A SCRIPT

0

@TNTIsLyfe LOL. I rushed so hard to make that, took like 20s, I just saw the post.

0

its ok man u got the script first i lost

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.