I need help on this script i tried everything and can't find the problem, I'm trying to make it were you click "G" and a frame will pop up like a backpack gui please help and thanks
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
Mouse.KeyDown:connect(function(Key)
if Key:lower() == "g" then
if script.Parent.MainFrame.Visible == false then -- if the location's visible property is true then
script.Parent.MainFrame.Visible = true -- DO this
else -- Otherwise,
script.Parent.MainFrame.Visible = false -- Do this
end
-- That's all
end
end)

3 comments
the local Mouse is suppose to be on line 2 but its just making it weird :l
This code will not work because: 1. You are having the code set the GUIs Visibility in STARTERGUI to true, not the ACTUAL Player's PLAYERGUI. 2. PlayerGui displays/replicates a GUI, StarterGui only Clones the GUIs/Children into the Player's PlayerGui, but your code is changing the Visibility in 'StarterGui', not the PlayerGui, thus, this code will not work until the Player resets multiple times.
Whoops. Forgot to move the mouse.