Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does it work once and then move to the same spot?

Asked by
MAKKU 37
4 years ago

So i want to move the player every time he clicks F but instead this works once and then just moves the player to one place. This is a localscript inside StarterCharacterScripts

UIS.InputBegan:connect(function(Input)
    local MouseInput = Input.UserInputType 
    local KeyCode = Input.KeyCode

    if KeyCode == Enum.KeyCode.F then
      plr.Character.HumanoidRootPart.CFrame =                    
      CFrame.new(plr.Character.Head.CFrame.lookVector * 15)
    end
end)
0
What is the use of "Head.CFrame.lookVector" in this? Juolite395 11 — 4y
0
I want to move in the direction the character is looking MAKKU 37 — 4y
0
Do you want the character to constantly move forward? BlackOrange3343 2676 — 4y

Answer this question