spawn(function()while wait(cooldown)do if check_movement()then footstepsSound.SoundId=get_material()footstepsSound.Parent=nil footstepsSound.Parent=rootPart end end end)

spawn(function()
    while wait(cooldown) do
        
        if check_movement() then
            
            footstepsSound.SoundId = get_material()
            
            footstepsSound.Parent = nil
            footstepsSound.Parent = rootPart
        end
    end
end)
