This is a local script inside a GUI inside a frame, and it should be working. what it is supposed to do is make a GUI visible, but it is not.

player = game.Players.LocalPlayer

mouse = player:GetMouse()

mouse.KeyDown:Connect(function(key)

if key.KeyCode == Enum.KeyCode.Space

then script.Parent.Frame.Visible = true

end

end)

mouse.KeyUp:Connect(function(key)

if key.KeyCode == Enum.KeyCode.Space

then script.Parent.Frame.Visible = false

end

end)

3 comments

0

I am not really sure about that but i think you need to use user input service to be able to call the space bar

0

Yes I think.

0

Mouse.KeyDown is deprecated, make sure to use UserInputService in future work