I made a tool that moves your character in the direction that you're looking (supposedly,) however it does not work. Here is the script:
script.Parent.Equipped:connect(function() while true do local cf = game.Players.LocalPlayer.Character.Torso.CFrame cf = cf + Vector3.new(2,0,0)*cf.lookVector wait(0.2) end wait(0.1) end)
It only moves me left or right depending on how I'm looking, rather than any direction. Help?
local cf = game.Players.LocalPlayer.Character.Torso.CFrame cf = cf * cf.lookVector
Vector3 will move your character depending on the world's X,Y,Z axis. LookVector is what you want to use.
If you want to move by 2 studs, you would multiply the direction by 2.
local cf = game.Players.LocalPlayer.Character.Torso.CFrame cf = cf * (cf.lookVector * 2)
player = game.Players.LocalPlayer script.Parent.Activated:connect(function() while true do player.Character.Torso.CFrame = player.Character.Torso.CFrame*CFrame.new(0,0,-2) wait(0.2) end wait(.1) end)