I can see in the debugger that the InventoryFrame is set to false, but nothing happens. InventoryFrame is a frame consisting of other frames. I will remember to accept a fulfilling answer
InventoryFrame = game.StarterGui.ToolBar.DisplayInventory.InventoryFrame script.Parent.Activated:Connect(function() if InventoryFrame.Visible == false then InventoryFrame.Visible = true else InventoryFrame.Visible = false end end)
Simple fix! Make sure you're using a localscript. You can't use the StarterGui.
local Players = game:GetService("Players") local PlayerGui = Players.LocalPlayer.PlayerGui InventoryFrame = PlayerGui.ToolBar.DisplayInventory.InventoryFrame script.Parent.Activated:Connect(function() if InventoryFrame.Visible == false then InventoryFrame.Visible = true else InventoryFrame.Visible = false end end)
Simple version of the if statement (4 lines):
InventoryFrame = game.StarterGui.ToolBar.DisplayInventory.InventoryFrame script.Parent.Activated:Connect(function() InventoryFrame.Visible = not InventoryFrame.Visible end)