How to make a KEY (X) to open a GUI | Roblox Studio

Published: 11 May 2024
on channel: Itz_FloppyFish
4,604
193

In todays video I show you how to make a KEY (X) to open a gui in Roblox Studio. How this system works is when a player clicks a key on their keyboard, a gui then opens, but then when they click x again while the gui is open, it will then close. This type of system is seen in a number of Roblox games, such as Pet Simulator x. So..... if you did want this type of system in your game make sure to watch to the end of the video to find out how!

I really enjoy making these videos for you all so I hope you enjoy them just as much as I do!
Have a lovely rest of your day!

Script 1 (Main Script):

local Gui = script.Parent

local function onKeyPress(input)
if input.KeyCode == Enum.KeyCode.X then -- Change X to whatever key you want to press to open the gui.
if Gui.Visible == true then
Gui.Visible = false
else
Gui.Visible = true
end
end
end

game:GetService("UserInputService").InputBegan:Connect(onKeyPress)
-- Made with love by Floppy!

-----------------------------
If you are a bit confused what to do, Feel free to create a ticket in my discord server and we can help you out!

NEW! Floppys Obby Game : https://www.roblox.com/games/14917960...

Floppys Simulator Game: https://www.roblox.com/games/13963457...

If you would like to support me even more, Super Thanks and becoming a Member is also another way to show your appreciation!

🌟 Floppys Discord Server:   / discord  
🌟 Floppys Roblox Game : https://www.roblox.com/games/11301003...

Roblox Studio Tutorial
Roblox Studio
Studio Tutorials


Watch video How to make a KEY (X) to open a GUI | Roblox Studio online without registration, duration hours minute second in high quality. This video was added by user Itz_FloppyFish 11 May 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 4,604 once and liked it 193 people.