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
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
Yes I think.
Mouse.KeyDown is deprecated, make sure to use UserInputService in future work