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

How do I make a Button activated Gui?

Does anyone know how to make it so when you press a button (not shift), a ScreenGui becomes visible? I would love some constructive feedback.

1 answer

You can use UserInputService or KeyDown/KeyUp for getting keyboard input.

Localscript:

Game:GetService("UserInputService").InputBegan:connect(function(input)
	if input.KeyCode == Enum.KeyCode.KEY then
		local Gui = game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame
		Gui.Visible = true
		--[[Or use
		Gui.Visible = not Gui.Visible
		for toggling visibility]]
	end
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.