Help with dust trail

Hello, I’m trying to make a dust trail that appears when the player walks. I’m having some troubles doing so if you can help me out that would be great!
VIDEO
CURRENT CODE: IN A SERVER SCRIPT

local currentLeg = script.Parent["Right Leg"]
game:GetService("RunService").Heartbeat:Connect(function()
	local particle = script.cloud:Clone()
	particle.Size = particle.Size
	particle.Position = currentLeg.Position
	particle.Parent = game:GetService("Workspace")
	local tween = game:GetService("TweenService"):Create(particle, TweenInfo.new(0.75, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {["Size"] = Vector3.new(0, 0, 0)})
	tween:Play()
	tween.Completed:Wait()
	particle:Destroy()
	if (currentLeg == script.Parent["Right Leg"]) then
		currentLeg = script.Parent["Left Leg"]
	elseif (currentLeg == script.Parent["Left Leg"]) then
		currentLeg = script.Parent["Right Leg"]
	end
	wait(0.5)
end)

u should only load da trail when plr is movin

ig u kr dis already, but u will check humanoid.movedirection.magnitude for dat

how would i fix it so it comes out slower and is closer to the feet/legs?