I have a store gui that opens by stepping on a part, and I want to make it so that when I press the X key on a keyboard it goes away. This is my script
local UserInputService = game:GetService("UserInputService")
local function onInputBegan(input, gameProcessed)
if keyCode.keyCode == Enum.KeyCode.X then
plr:WaitForChild("PlayerGui").Store.ar.Visible = false
end

1 comment
Thanks it works. Is there a way I can change it so that if you close the gui and step on the part again you can reopen the gui without resetting your character? thanks