Basically, When you are near the Part, and you hold E for 5 seconds, it should print "Hi" Everything works, im a bit confused at the runservice part
** dt = dt + game:GetService('RunService').RenderStepped:Wait();**
Can someone explain this more in depth pls?
UIS.InputBegan:Connect(function(Key, Process)
if (Process) then return nil end;
if (Key.KeyCode == Enum.KeyCode.E) then
local dt = 0;
while ( (part.Position - Humanoid.Position).magnitude < 10) and UIS:IsKeyDown(Key.KeyCode) do
if (dt >= 5) then
print("hi")
break;
end
dt = dt + game:GetService('RunService').RenderStepped:Wait();
end
end
end)

1 comment
Um, you explained what I knew already :/ as I said, i need the dt = dt + game:GetService('RunService').RenderStepped:Wait(); explained