I am attempting to write a code that if you don't press the "H" key for 5 seconds, your backgui will disappear. It's like an inventory is what I'm trying to make.
The code:
local function onKeyDown( key )
print("Key:", H, " Code:", string.byte(key))
then
game.StarterGui:SetCoreGuiEnabled("2", false)
wait(0.1)
game.StarterGui:SetCoreGuiEnabled("2", true)
wait(5)
game.StarterGui:SetCoreGuiEnabled("2", false
end
mouse.KeyDown:connect(onKeyDown)
