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)