Basically this is just a test teleport script and I am trying to figure out how to loop it while the V key is held down. When you press V it teleports you to two different locations as you can see below. Would it be possible to keep teleporting back and forth (loop) and stop when you let go of the V key? I can't seem to figure this out. Your help is very much appreciated!
local client = game:GetService("Players").LocalPlayer
game:GetService("UserInputService").InputBegan:Connect(function(input, gpe)
if gpe then return end
if input.KeyCode == Enum.KeyCode.V then
client.Character:SetPrimaryPartCFrame(CFrame.new(275,3.94,347.568))
wait(0.1)
client.Character:SetPrimaryPartCFrame(CFrame.new(275,5.94,347.568))
end
end)

4 comments
did you try a while loop? not certain but would be my first thought
Have you tried using tweening methods?
It is possible I formatted it wrong but adding While did not work for me :/
@xPolarium I have not tried. I am not sure how to incorporate that into the script. I was under the impression that tweening was only for animations.