local mouse = game.Players.LocalPlayer:GetMouse() local gui = script.Parent.ScreenGUI.Frame
mouse.KeyDown:Connect(function(key) if key == "m" then gui.Visible = not gui.Visible end end)
that is my script anyways its not working I dont know why but if someone can help it would be nice it also says in the output ScreenGUI is not a valid member of Players.pocvq.PlayerGui
Try this:
local Player = game:GetService("Players").LocalPlayer local mouse = Player:GetMouse() local PlayerGUI = Player:WaitForChild("PlayerGui") local gui = PlayerGUI.ScreenGUI.Frame mouse.KeyDown:Connect(function(key) if key == "m" then gui.Visible = false end end)
Sometimes the script runs faster than the assets.