I have it so that if you double tap LeftControl, your avatar will start moving forwards automatically. I want it so that if you press LeftControl again (bonus question: is there a better way to detect if the player pressed w, a, s, d rather than having to list "(inputObject.KeyCode == Enum.KeyCode.Button)" for each one?), RenderStepped will stop. This is what I have:
if (inputObject.KeyCode == Enum.KeyCode.LeftControl) then
if IsEnabled then
local now = tick()
local difference = (now - lastTime)
local Stepped
if difference <= 0.5 then
Stepped = RUN_SERVICE.RenderStepped:Connect(function()
LOCAL_PLAYER.Character:WaitForChild("Humanoid"):Move(Vector3.new(0,0,-1), true)
end)
else
if not Stepped == nil then
Stepped:Disconnect()
print("disc")
end
end
lastTime = tick()
end
end
When I press LeftControl to disconnect RS, it is unresponsive.
