Sorry for any English mistakes. I'm trying to do a LongJump script. The script is working but using the CFrame.LookVector doesn't work really well. I tried using the Vector 3 and Cframe,but because I'm really bad at doing it I don't know how to create a Vector 3 that is orientated by where the player is looking.
the Long Jump script.
function LongJump()
if CR and debounce2 then
CR = false
AP = true
animTrackLongJump:Play()
if animTrackroll.IsPlaying then
animTrackroll:Stop()
end
debounce2 = false
humanoid.JumpPower = 20
humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
print("longjump")
local Root = localPlayer.character:WaitForChild("HumanoidRootPart")
Root.Velocity =Root.Cframe.LookVector*(30+humanoid.WalkSpeed*2)
repeat wait()
animTrackLongJump:Play()
animTrackLongJump.TimePosition = 0.100
until humanoid:GetState()== Enum.HumanoidStateType.Landed
or humanoid:GetState() == Enum.HumanoidStateType.Jumping
animTrackLongJump:Stop()
humanoid.JumpPower = 50
debounce2 = true
end
end

3 comments
Vector3 + Vector3
I tried using the lookvector + vector.new (0,1,2) but the problem is that doing this make that the long jump only goes in one direction.
Now I undertood how to use the RootDirections,I did the lookvector + the up vector and multiplied the lookvector by 1.5 and the up vector by 0.5