local hold = 0
local UIS = game:GetService("UserInputService")
UIS.InputBegan:Connect(function(input, keypressed)
if input.KeyCode == Enum.KeyCode.E then
hold = hold + 1
-- if hold == 5(seconds has passed) then
-- continue code
button = input.InputEnded or InputChanged:Connect(function(inp)
if inp == "UserInputState" then
button:Disconnect()
end)
Something like this? Dunno if it’ll work but the premise is every time the counter reaches a set number, the interact menu will pop up.
If you’re trying to see if E is held, why are you checking left shift?
And if you wait it to be like for 3 seconds as I see the wait there, I usually do something like this:
local waiting = 0
while UserInputService:IsKeyDown(Enum.KeyCode.E) do
wait(1)
waiting = waiting + 1
if(waiting == 3) then
break
end
end
if(waiting == 3) then
--Code
else
waiting = 0
end