So I made a local script where you press f for a gui to pop up but it keeps giving me the error “attempt to index nil with keycode”
local uis = game:GetService("UserInputService")
local debounce = false
local function onInputBegan(input, gameProcessed)
if input.KeyCode == Enum.KeyCode.F then
if debounce == false then
script.Parent.Enabled = true
debounce = true
else
script.Parent.Enabled = false
debounce = false
end
end
end
uis.InputBegan:Connect(function()
if game.ReplicatedStorage.InMenu.Value == false then
onInputBegan()
end
end)