THE OPENING PART IS WORKING Here is the script
--Ignore lines 1 to 9 thats the working part
--Opening part
local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()
mouse.KeyDown:connect(function(key)
if key:lower() == "e" then
plr.PlayerGui.Inventory.Main.Visible = true
end
end)
--Closing part
mouse.KeyDown:connect(function(key)
if plr.PlayerGui.Inventory.Main.Visible == true then
if key:lower() == "e" then
plr.PlayerGui.Inventory.Main.Visible = false
end
end
end)
No output appears

3 comments
Not working :(
Edited, should work. Make sure the code is in a Local Script. If it still doesn't work, try placing the local script in the StarterPack, that worked for me.
I just decided to make a close button