So I want to open an Inventory when I press a button. I made a script but it just won't work and I can't figure it out. Can some1 help me? I'm prety new at scripting so maybe it's prety obvius what I should do.
local inv = game.StarterGui.InventoryGui local ContextActionService = game:GetService("ContextActionService") inv.Enabled = false local function openInv(actionName, inputState, inputObject) if actionName == "OpenInv" then if inputState == Enum.UserInputState.Begin and inv.Enabled == false then inv.Enabled = true elseif inputState == Enum.UserInputState.Begin and inv.Enabled == true then inv.Enabled = false end end end ContextActionService:BindAction("OpenInv", openInv, true, Enum.KeyCode.G)
(ps. Sorry for my English if it's a little bad.)