local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
character.Humanoid:GetPropertyChangedSignal("MoveDirection"):Connect(function()
local direction = character.Humanoid.MoveDirection
if direction.Magnitude > 0 then
character:SetPrimaryPartCFrame(CFrame.new(character.PrimaryPart.Position, character.PrimaryPart.Position + direction))
end
end)