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

How do I make a Button activated Gui?

Asked by 9 years ago

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

Log in to vote
0
Answered by 9 years ago

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

Answer this question