I don't get any errors, but as Soon as I press E, it prints "Hi" and not when I hold for 5 seconds :#
local UIS = game:GetService("UserInputService")
local Humanoid = game.Players.LocalPlayer.Character:WaitForChild("HumanoidRootPart")
local part = workspace.joinTable
local Start = tick()
UIS.InputBegan:Connect(function(key)
if key.KeyCode == Enum.KeyCode.E then
if (part.Position - Humanoid.Position).magnitude < 10 then
if tick() - Start >= 5 then
print("hi")
end
end
end
end)

2 comments
I hold E, and it doesn't work :/ I don't get any print or any errors
May or may not made it so the function would only run if they were typing in a textbox. Anywho, fixed.