I'm trying to make a frame visible when you press space bar
UserInputService may help you with that. UserInputService just allows you to use other keys on the keyboard, and you can use stuff like F4, F5, etc. Put this script in StarterPlayerScripts, and make it a LocalScript. (I'll be using --comments
to explain stuff.):
local UIS = game:GetService("UserInputService") local player = game.Players.LocalPlayer local plrGui = player.PlayerGui --This gets the Gui, assuming you're using StarterGui. UIS.InputBegan:Connect(function(input, GPE) --This event will fire, whenever input is pressed. GPE means Game Processed event. if GPE then return end --If someone is chatting, then do nothing if input.KeyCode = Enum.KeyCode.Space then --If the input is space then plrGui.ScreenGui.Frame.Visible = not plrGui.ScreenGui.Frame.Visible --If it's not visible, then it's visible, and vice versa. end end)